diff --git a/StartGamedev-160604-osx/game.apk b/StartGamedev-160604-osx/game.apk index b6a762c..d89efe7 100644 Binary files a/StartGamedev-160604-osx/game.apk and b/StartGamedev-160604-osx/game.apk differ diff --git a/StartGamedev-160604-osx/game.love b/StartGamedev-160604-osx/game.love index 9e5be30..4d28107 100644 Binary files a/StartGamedev-160604-osx/game.love and b/StartGamedev-160604-osx/game.love differ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/AndroidManifest.xml b/StartGamedev-160604-osx/tools/love-android-sdl2/AndroidManifest.xml index 36a2b7a..7c1dc84 100644 --- a/StartGamedev-160604-osx/tools/love-android-sdl2/AndroidManifest.xml +++ b/StartGamedev-160604-osx/tools/love-android-sdl2/AndroidManifest.xml @@ -1,5 +1,5 @@ - @@ -12,13 +12,13 @@ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/assets/game.love b/StartGamedev-160604-osx/tools/love-android-sdl2/assets/game.love index 9e5be30..4d28107 100644 Binary files a/StartGamedev-160604-osx/tools/love-android-sdl2/assets/game.love and b/StartGamedev-160604-osx/tools/love-android-sdl2/assets/game.love differ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/AndroidManifest.xml b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/AndroidManifest.xml index 36a2b7a..7c1dc84 100644 --- a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/AndroidManifest.xml +++ b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/AndroidManifest.xml @@ -1,5 +1,5 @@ - @@ -12,13 +12,13 @@ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/build.prop b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/build.prop index ae57b35..921a47f 100644 --- a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/build.prop +++ b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/build.prop @@ -1,5 +1,5 @@ #Last build type -#Fri, 04 Nov 2016 17:37:41 +0100 +#Fri, 04 Nov 2016 18:12:11 +0100 build.last.target=debug diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes.dex b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes.dex index 5930351..493ad7d 100644 Binary files a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes.dex and b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes.dex differ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes.dex.d b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes.dex.d index df406d1..eb0240c 100644 --- a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes.dex.d +++ b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes.dex.d @@ -1,9 +1,9 @@ /Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes.dex : \ -/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/BuildConfig.class \ -/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/LtaActivity.class \ -/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/R$attr.class \ -/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/R$drawable.class \ -/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/R.class \ +/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/BuildConfig.class \ +/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/LtaActivity.class \ +/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/R$attr.class \ +/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/R$drawable.class \ +/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/R.class \ /Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/org/libsdl/app/DummyEdit.class \ /Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/org/libsdl/app/SDLActivity$1.class \ /Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/org/libsdl/app/SDLActivity$2.class \ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/R$attr.class b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/R$attr.class deleted file mode 100644 index f7896ac..0000000 Binary files a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/R$attr.class and /dev/null differ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/BuildConfig.class b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/BuildConfig.class similarity index 74% rename from StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/BuildConfig.class rename to StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/BuildConfig.class index a7ccc5e..d70c5e6 100644 Binary files a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/BuildConfig.class and b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/BuildConfig.class differ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/LtaActivity.class b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/LtaActivity.class similarity index 62% rename from StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/LtaActivity.class rename to StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/LtaActivity.class index e2f8d55..b92edb3 100644 Binary files a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/LtaActivity.class and b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/LtaActivity.class differ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/R$attr.class b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/R$attr.class new file mode 100644 index 0000000..f1b433c Binary files /dev/null and b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/R$attr.class differ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/R$drawable.class b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/R$drawable.class similarity index 56% rename from StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/R$drawable.class rename to StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/R$drawable.class index fa2da6b..55fcda0 100644 Binary files a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/R$drawable.class and b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/R$drawable.class differ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/R.class b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/R.class similarity index 63% rename from StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/R.class rename to StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/R.class index 23edd99..d3177ab 100644 Binary files a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104173735/R.class and b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1104181206/R.class differ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/love_android_sdl2-debug-unaligned.apk b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/love_android_sdl2-debug-unaligned.apk index bb330de..832e543 100644 Binary files a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/love_android_sdl2-debug-unaligned.apk and b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/love_android_sdl2-debug-unaligned.apk differ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/love_android_sdl2-debug.apk b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/love_android_sdl2-debug.apk index b6a762c..d89efe7 100644 Binary files a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/love_android_sdl2-debug.apk and b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/love_android_sdl2-debug.apk differ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/love_android_sdl2.ap_ b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/love_android_sdl2.ap_ index ce7b042..1157715 100644 Binary files a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/love_android_sdl2.ap_ and b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/love_android_sdl2.ap_ differ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/proguard.txt b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/proguard.txt index 8a87a78..0ce6d27 100644 --- a/StartGamedev-160604-osx/tools/love-android-sdl2/bin/proguard.txt +++ b/StartGamedev-160604-osx/tools/love-android-sdl2/bin/proguard.txt @@ -1,9 +1,9 @@ # view AndroidManifest.xml #generated:45 --keep class love.to.android1104173735.DownloadActivity { (...); } +-keep class love.to.android1104181206.DownloadActivity { (...); } # view AndroidManifest.xml #generated:17 --keep class love.to.android1104173735.DownloadService { (...); } +-keep class love.to.android1104181206.DownloadService { (...); } # view AndroidManifest.xml #generated:18 --keep class love.to.android1104173735.LtaActivity { (...); } +-keep class love.to.android1104181206.LtaActivity { (...); } diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/gen/R.java.d b/StartGamedev-160604-osx/tools/love-android-sdl2/gen/R.java.d index fb4b449..ea30ff5 100644 --- a/StartGamedev-160604-osx/tools/love-android-sdl2/gen/R.java.d +++ b/StartGamedev-160604-osx/tools/love-android-sdl2/gen/R.java.d @@ -1,3 +1,3 @@ -/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1104173735/R.java \ +/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1104181206/R.java \ : /Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/res/drawable-xxhdpi/ic_launcher.png \ /Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/AndroidManifest.xml \ diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1104173735/BuildConfig.java b/StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1104181206/BuildConfig.java similarity index 79% rename from StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1104173735/BuildConfig.java rename to StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1104181206/BuildConfig.java index 26852a2..a178fac 100644 --- a/StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1104173735/BuildConfig.java +++ b/StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1104181206/BuildConfig.java @@ -1,5 +1,5 @@ /** Automatically generated file. DO NOT MODIFY */ -package love.to.android1104173735; +package love.to.android1104181206; public final class BuildConfig { public final static boolean DEBUG = true; diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1104173735/R.java b/StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1104181206/R.java similarity index 91% rename from StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1104173735/R.java rename to StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1104181206/R.java index c82ca79..265afd4 100644 --- a/StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1104173735/R.java +++ b/StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1104181206/R.java @@ -5,7 +5,7 @@ * should not be modified by hand. */ -package love.to.android1104173735; +package love.to.android1104181206; public final class R { public static final class attr { diff --git a/StartGamedev-160604-osx/tools/love-android-sdl2/src/love/to/android1104173735/LtaActivity.java b/StartGamedev-160604-osx/tools/love-android-sdl2/src/love/to/android1104181206/LtaActivity.java similarity index 69% rename from StartGamedev-160604-osx/tools/love-android-sdl2/src/love/to/android1104173735/LtaActivity.java rename to StartGamedev-160604-osx/tools/love-android-sdl2/src/love/to/android1104181206/LtaActivity.java index 425823d..df0c2a5 100644 --- a/StartGamedev-160604-osx/tools/love-android-sdl2/src/love/to/android1104173735/LtaActivity.java +++ b/StartGamedev-160604-osx/tools/love-android-sdl2/src/love/to/android1104181206/LtaActivity.java @@ -1,4 +1,4 @@ -package love.to.android1104173735; +package love.to.android1104181206; import org.love2d.android.GameActivity; public class LtaActivity extends GameActivity {} diff --git a/main.lua b/main.lua index 9bd0f10..a985198 100644 --- a/main.lua +++ b/main.lua @@ -33,6 +33,8 @@ function love.load() ship.shape = love.physics.newCircleShape(20) ship.fixture = love.physics.newFixture(ship.body, ship.shape, 1) ship.fixture:setRestitution(0.9) + ship.time_start = 1 + start_time = 0 -- Fire fire = {} fire.img = love.graphics.newImage('assets/sprite/fire.png') @@ -116,6 +118,7 @@ end -- UPDATE function love.update(dt) + start_time = dt + start_time -- Sprite if not explosion.finish and explosion.active then -- Explosion explosion.time = explosion.time + dt @@ -144,31 +147,33 @@ function love.update(dt) fire.pos_frame = 1 end -- Controls - control_up, control_right, control_left, control_quit = false, false, false, false - -- Keyboard - if love.keyboard.isDown('escape') or love.keyboard.isDown('q') then - control_quit = true - end - if love.keyboard.isDown('right') then - control_right = true - elseif love.keyboard.isDown('left') then - control_left = true - end - if love.keyboard.isDown('up') then - control_up = true - end - -- Mouse - if love.mouse.isDown(1) then - local x, y = love.mouse.getPosition() - -- Up - if x > button_up.x and x < button_up.x + button.img:getWidth() and y > button_up.y + camera.y and y < button_up.y + button.img:getHeight() + camera.y then - control_up = true + if start_time > ship.time_start then + control_up, control_right, control_left, control_quit = false, false, false, false + -- Keyboard + if love.keyboard.isDown('escape') or love.keyboard.isDown('q') then + control_quit = true end - -- Right - if x > button_right.x and x < button_right.x + button.img:getWidth() and y > button_right.y + camera.y and y < button_right.y + button.img:getHeight() + camera.y then - control_right = true - elseif x > button_left.x and x < button_left.x + button.img:getWidth() and y > button_left.y + camera.y and y < button_left.y + button.img:getHeight() + camera.y then - control_left = true + if love.keyboard.isDown('right') then + control_right = true + elseif love.keyboard.isDown('left') then + control_left = true + end + if love.keyboard.isDown('up') then + control_up = true + end + -- Mouse + if love.mouse.isDown(1) then + local x, y = love.mouse.getPosition() + -- Up + if x > button_up.x and x < button_up.x + button.img:getWidth() and y > button_up.y + camera.y and y < button_up.y + button.img:getHeight() + camera.y then + control_up = true + end + -- Right + if x > button_right.x and x < button_right.x + button.img:getWidth() and y > button_right.y + camera.y and y < button_right.y + button.img:getHeight() + camera.y then + control_right = true + elseif x > button_left.x and x < button_left.x + button.img:getWidth() and y > button_left.y + camera.y and y < button_left.y + button.img:getHeight() + camera.y then + control_left = true + end end end -- Ship move @@ -291,35 +296,37 @@ function love.draw() love.graphics.draw(explosion.img, explosion.frames[explosion.pos_frame], ship.body:getX(), ship.body:getY() + ship.img:getHeight() / 2) end -- Controls - -- Up - button_up.y = level.y + (camera.height / 4) + -camera.y - local button_frame_up = button.frames[1] - if control_up then - button_frame_up = button.frames[2] - end - love.graphics.draw(button.img, button_frame_up, button_up.x, button_up.y) - if debug then - love.graphics.rectangle('fill', button_up.x, button_up.y, button.img:getWidth(), button.img:getHeight()) - end - -- Right - button_right.y = button_up.y + (button.img:getHeight() + (button.img:getHeight() / 3)) - local button_frame_right = button.frames[1] - if control_right then - button_frame_right = button.frames[2] - end - love.graphics.draw(button.img, button_frame_right, button_right.x + (button.img:getWidth() / (2 * button.num_frames)), button_right.y + button.img:getHeight(), 90 * math.pi / 180, 1, 1, button.img:getWidth() / 2, button.img:getHeight() / 2) - if debug then - love.graphics.rectangle('fill', button_right.x, button_right.y, button.img:getWidth(), button.img:getHeight()) - end - -- Left - button_left.y = button_right.y - local button_frame_left = button.frames[1] - if control_left then - button_frame_left = button.frames[2] - end - love.graphics.draw(button.img, button_frame_left, button_left.x + (button.img:getWidth() / (2 * button.num_frames)), button_left.y, 270 * math.pi / 180, 1, 1, button.img:getWidth() / 2, button.img:getHeight() / 2) - if debug then - love.graphics.rectangle('fill', button_left.x, button_left.y, button.img:getWidth(), button.img:getHeight()) + if start_time > ship.time_start then + -- Up + button_up.y = level.y + (camera.height / 4) + -camera.y + local button_frame_up = button.frames[1] + if control_up then + button_frame_up = button.frames[2] + end + love.graphics.draw(button.img, button_frame_up, button_up.x, button_up.y) + if debug then + love.graphics.rectangle('fill', button_up.x, button_up.y, button.img:getWidth(), button.img:getHeight()) + end + -- Right + button_right.y = button_up.y + (button.img:getHeight() + (button.img:getHeight() / 3)) + local button_frame_right = button.frames[1] + if control_right then + button_frame_right = button.frames[2] + end + love.graphics.draw(button.img, button_frame_right, button_right.x + (button.img:getWidth() / (2 * button.num_frames)), button_right.y + button.img:getHeight(), 90 * math.pi / 180, 1, 1, button.img:getWidth() / 2, button.img:getHeight() / 2) + if debug then + love.graphics.rectangle('fill', button_right.x, button_right.y, button.img:getWidth(), button.img:getHeight()) + end + -- Left + button_left.y = button_right.y + local button_frame_left = button.frames[1] + if control_left then + button_frame_left = button.frames[2] + end + love.graphics.draw(button.img, button_frame_left, button_left.x + (button.img:getWidth() / (2 * button.num_frames)), button_left.y, 270 * math.pi / 180, 1, 1, button.img:getWidth() / 2, button.img:getHeight() / 2) + if debug then + love.graphics.rectangle('fill', button_left.x, button_left.y, button.img:getWidth(), button.img:getHeight()) + end end -- Texts if not play and not win then -- Game over @@ -362,7 +369,7 @@ function restart(level_arg) local temp_img = img_asteroide[math.random(1, table_length(img_asteroide))] asteroids[i] = { x = math.random(0, canvas.width - temp_img:getWidth()), - y = math.random(200, canvas.height - temp_img:getHeight()), + y = math.random(window.height / 2, canvas.height - temp_img:getHeight()), speed = math.random(1, max_speed_asteroids), img = temp_img, angle = math.random(0, 90) @@ -372,6 +379,7 @@ function restart(level_arg) ship.body = love.physics.newBody(world, (canvas.width / 2) - (ship.img:getWidth() / 2) , ship.y, 'dynamic') win = false play = true + start_time = 0 end -- Controls