Add alls controls android

This commit is contained in:
Andros Fenollosa 2016-11-04 17:40:10 +01:00
parent 2da53b81ef
commit 20b7769ca0
24 changed files with 56 additions and 21 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="love.to.android1103235521"
<manifest package="love.to.android1104173735"
android:versionCode="15"
android:versionName="0.9.2"
android:installLocation="auto" xmlns:android="http://schemas.android.com/apk/res/android">
@ -12,13 +12,13 @@
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="Game 1103235521"
android:label="Game 1104173735"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<service android:name=".DownloadService" />
<activity
android:name="LtaActivity"
android:configChanges="orientation|screenSize"
android:label="Game 1103235521"
android:label="Game 1104173735"
android:launchMode="singleTop"
android:screenOrientation="landscape" >
<intent-filter>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="love.to.android1103235521"
<manifest package="love.to.android1104173735"
android:versionCode="15"
android:versionName="0.9.2"
android:installLocation="auto" xmlns:android="http://schemas.android.com/apk/res/android">
@ -12,13 +12,13 @@
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="Game 1103235521"
android:label="Game 1104173735"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<service android:name=".DownloadService" />
<activity
android:name="LtaActivity"
android:configChanges="orientation|screenSize"
android:label="Game 1103235521"
android:label="Game 1104173735"
android:launchMode="singleTop"
android:screenOrientation="landscape" >
<intent-filter>

View File

@ -1,5 +1,5 @@
#Last build type
#Thu, 03 Nov 2016 23:55:26 +0100
#Fri, 04 Nov 2016 17:37:41 +0100
build.last.target=debug

View File

@ -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/android1103235521/BuildConfig.class \
/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1103235521/LtaActivity.class \
/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1103235521/R$attr.class \
/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1103235521/R$drawable.class \
/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1103235521/R.class \
/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/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 \

View File

@ -1,9 +1,9 @@
# view AndroidManifest.xml #generated:45
-keep class love.to.android1103235521.DownloadActivity { <init>(...); }
-keep class love.to.android1104173735.DownloadActivity { <init>(...); }
# view AndroidManifest.xml #generated:17
-keep class love.to.android1103235521.DownloadService { <init>(...); }
-keep class love.to.android1104173735.DownloadService { <init>(...); }
# view AndroidManifest.xml #generated:18
-keep class love.to.android1103235521.LtaActivity { <init>(...); }
-keep class love.to.android1104173735.LtaActivity { <init>(...); }

View File

@ -1,3 +1,3 @@
/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1103235521/R.java \
/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/res/drawable-xxhdpi/ic_launcher.png \
/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/AndroidManifest.xml \

View File

@ -1,5 +1,5 @@
/** Automatically generated file. DO NOT MODIFY */
package love.to.android1103235521;
package love.to.android1104173735;
public final class BuildConfig {
public final static boolean DEBUG = true;

View File

@ -5,7 +5,7 @@
* should not be modified by hand.
*/
package love.to.android1103235521;
package love.to.android1104173735;
public final class R {
public static final class attr {

View File

@ -1,4 +1,4 @@
package love.to.android1103235521;
package love.to.android1104173735;
import org.love2d.android.GameActivity;
public class LtaActivity extends GameActivity {}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -84,8 +84,14 @@ function love.load()
love.graphics.newQuad(button.frame_width * 1, 0, button.frame_width, button.frame_height, button.img:getWidth(), button.img:getHeight())
}
button_up = {}
button_up.x = window.width - button.img:getWidth()
button_up.x = window.width - (button.img:getWidth() / button.num_frames) - (button.img:getWidth() / (2 * button.num_frames))
button_up.y = level.y + (camera.height / 4) + -camera.y
button_right = {}
button_right.x = button_up.x
button_right.y = button_up.y + (button.img:getHeight() / 3)
button_left = {}
button_left.x = button.img:getWidth() / (2 * button.num_frames)
button_left.y = button_right.y
-- Generates initial asteroids
asteroids_collision = 40
asteroids_collision_polygon = 8
@ -158,6 +164,12 @@ function love.update(dt)
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
-- Ship move
if control_up then
@ -193,7 +205,7 @@ function love.update(dt)
local temp_img = img_asteroide[math.random(1, table_length(img_asteroide))]
asteroids[table_length(asteroids) + 1] = {
x = canvas.width + temp_img:getWidth(),
y = math.random(window.height / 2, canvas.height - temp_img:getHeight()),
y = math.random(window.height, canvas.height - temp_img:getHeight()),
speed = math.random(1, max_speed_asteroids),
img = temp_img,
angle = math.random(0, 90)}
@ -286,6 +298,29 @@ function love.draw()
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
-- Texts
if not play and not win then -- Game over
love.graphics.print(text_restart.text, (camera.width / 2) - (text_restart.size / 2), -camera.y + (camera.height / 2))