Add mouse control
This commit is contained in:
parent
8ec8327e5e
commit
a397edf8f1
StartGamedev-160604-osx
game.apkgame.love
main.luatools/love-android-sdl2
AndroidManifest.xml
assets
bin
AndroidManifest.xmlbuild.propclasses.dexclasses.dex.dlove_android_sdl2-debug-unaligned.apklove_android_sdl2-debug.apklove_android_sdl2.ap_proguard.txt
classes/love/to
android1103000152
android1103235521
gen
src/love/to/android1103235521
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="love.to.android1103000152"
|
||||
<manifest package="love.to.android1103235521"
|
||||
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 1103000152"
|
||||
android:label="Game 1103235521"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
|
||||
<service android:name=".DownloadService" />
|
||||
<activity
|
||||
android:name="LtaActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="Game 1103000152"
|
||||
android:label="Game 1103235521"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="landscape" >
|
||||
<intent-filter>
|
||||
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="love.to.android1103000152"
|
||||
<manifest package="love.to.android1103235521"
|
||||
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 1103000152"
|
||||
android:label="Game 1103235521"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
|
||||
<service android:name=".DownloadService" />
|
||||
<activity
|
||||
android:name="LtaActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:label="Game 1103000152"
|
||||
android:label="Game 1103235521"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="landscape" >
|
||||
<intent-filter>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#Last build type
|
||||
#Thu, 03 Nov 2016 00:01:59 +0100
|
||||
#Thu, 03 Nov 2016 23:55:26 +0100
|
||||
|
||||
build.last.target=debug
|
||||
|
||||
|
Binary file not shown.
@ -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/android1103000152/BuildConfig.class \
|
||||
/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1103000152/LtaActivity.class \
|
||||
/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1103000152/R$attr.class \
|
||||
/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1103000152/R$drawable.class \
|
||||
/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1103000152/R.class \
|
||||
/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/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 \
|
||||
|
BIN
StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1103000152/R$attr.class
BIN
StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1103000152/R$attr.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1103235521/R$attr.class
Normal file
BIN
StartGamedev-160604-osx/tools/love-android-sdl2/bin/classes/love/to/android1103235521/R$attr.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
# view AndroidManifest.xml #generated:45
|
||||
-keep class love.to.android1103000152.DownloadActivity { <init>(...); }
|
||||
-keep class love.to.android1103235521.DownloadActivity { <init>(...); }
|
||||
|
||||
# view AndroidManifest.xml #generated:17
|
||||
-keep class love.to.android1103000152.DownloadService { <init>(...); }
|
||||
-keep class love.to.android1103235521.DownloadService { <init>(...); }
|
||||
|
||||
# view AndroidManifest.xml #generated:18
|
||||
-keep class love.to.android1103000152.LtaActivity { <init>(...); }
|
||||
-keep class love.to.android1103235521.LtaActivity { <init>(...); }
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/gen/love/to/android1103000152/R.java \
|
||||
/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/res/drawable-xxhdpi/ic_launcher.png \
|
||||
/Users/androsfenollosa/www/alunizaje/StartGamedev-160604-osx/tools/love-android-sdl2/bin/AndroidManifest.xml \
|
||||
|
@ -1,5 +1,5 @@
|
||||
/** Automatically generated file. DO NOT MODIFY */
|
||||
package love.to.android1103000152;
|
||||
package love.to.android1103235521;
|
||||
|
||||
public final class BuildConfig {
|
||||
public final static boolean DEBUG = true;
|
@ -5,7 +5,7 @@
|
||||
* should not be modified by hand.
|
||||
*/
|
||||
|
||||
package love.to.android1103000152;
|
||||
package love.to.android1103235521;
|
||||
|
||||
public final class R {
|
||||
public static final class attr {
|
@ -1,4 +1,4 @@
|
||||
package love.to.android1103000152;
|
||||
package love.to.android1103235521;
|
||||
import org.love2d.android.GameActivity;
|
||||
|
||||
public class LtaActivity extends GameActivity {}
|
49
main.lua
49
main.lua
@ -123,23 +123,44 @@ function love.update(dt)
|
||||
fire.pos_frame = 1
|
||||
end
|
||||
-- Controls
|
||||
-- Keyboard
|
||||
if love.keyboard.isDown('escape') or love.keyboard.isDown('q') then
|
||||
love.event.push('quit')
|
||||
end
|
||||
if love.keyboard.isDown('right') then
|
||||
ship.body:applyForce(ship.power, 0)
|
||||
fire.visible = true
|
||||
sounds.fire:play()
|
||||
elseif love.keyboard.isDown('left') then
|
||||
ship.body:applyForce(-ship.power, 0)
|
||||
fire.visible = true
|
||||
sounds.fire:play()
|
||||
end
|
||||
ship.body:applyForce(ship.power, 0)
|
||||
fire.visible = true
|
||||
sounds.fire:play()
|
||||
elseif love.keyboard.isDown('left') then
|
||||
ship.body:applyForce(-ship.power, 0)
|
||||
fire.visible = true
|
||||
sounds.fire:play()
|
||||
end
|
||||
if love.keyboard.isDown('up') then
|
||||
ship.body:applyForce(0, -ship.power)
|
||||
fire.visible = true
|
||||
sounds.fire:play()
|
||||
end
|
||||
ship.body:applyForce(0, -ship.power)
|
||||
fire.visible = true
|
||||
sounds.fire:play()
|
||||
end
|
||||
-- Mouse
|
||||
if love.mouse.isDown(1) then
|
||||
local x, y = love.mouse.getPosition()
|
||||
-- Up
|
||||
if x > width / 3 and x < width - (width / 3) and y < height / 3 then
|
||||
ship.body:applyForce(0, -ship.power)
|
||||
fire.visible = true
|
||||
sounds.fire:play()
|
||||
end
|
||||
-- Left
|
||||
if x < width / 3 then
|
||||
ship.body:applyForce(-ship.power, 0)
|
||||
fire.visible = true
|
||||
sounds.fire:play()
|
||||
elseif x > width - (width / 3) then
|
||||
ship.body:applyForce(ship.power, 0)
|
||||
fire.visible = true
|
||||
sounds.fire:play()
|
||||
end
|
||||
end
|
||||
-- Rotate asteroids
|
||||
for key, value in pairs(asteroids) do
|
||||
value.angle = asteroids[key].angle + (dt * math.pi / 10)
|
||||
@ -297,4 +318,8 @@ end
|
||||
-- Controls
|
||||
function love.keyreleased(key)
|
||||
sounds.fire:stop()
|
||||
end
|
||||
|
||||
function love.mousereleased(key)
|
||||
sounds.fire:stop()
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user