MonkeyPong!

Community Forums/Monkey Talk/MonkeyPong!

therevills(Posted 2011) [#1]
http://www.therevillsgames.com/monkey/monkeyDoc.html

Compiled for Flash, HTML5, Windows(exe) and Android!




EOF(Posted 2011) [#2]
Works ok on my Galaxy S although juddery. Can you compile a non-debug version?
Also, there is no proper way to quit the app though (I.E, via the back button)


therevills(Posted 2011) [#3]

Galaxy S although juddery


Im suprised, since your device has a 1Ghz CPU - my Android phone is the LG Optimus One with a 600Mhz CPU and the game is smooth...


non-debug version?


non-debug version... yeah... hmmm.... I change the option in Monk and JungleIDE from debug to release, but it always builds a debug version - I think... well the apk name is always MonkeyGame-debug.apk....

[Edit - Ive uploaded the release version... Monkey names it -debug even though you select Release. Ive renamed it.]


no proper way to quit the app though


Im not sure yet how to do this in Monkey :P

Last edited 2011


EOF(Posted 2011) [#4]
Thanks. That's better. The movement is very erratic for 5 seconds or so before things settle down

I am happy to see phone orientation is automatically handled but it leads to another problem - There is no OnOrientationChanged() (or GetOrientation() function) therefore no way to dictate how to handle the accelerometer values. For example in your game the player bat control works nicely in Portrait mode. Rotating to Landscape means that you effectively control the paddle by tilting the phone left/right

As for quitting the app, there needs to be something like:
Function OnEnd()
  #If TARGET="android" Then AppClose
End
Right now pressing HOME leaves the app running and I can only close it properly via Manage Apps > Force Stop 'app in question'

Could you highlight these issues in the Monkey forums? I am not registering or buying into Monkey just yet due to the current shortcomings


taumel(Posted 2011) [#5]
Nice, i was surprised that the HTML-5 version is performing better than the Flash version.


degac(Posted 2011) [#6]
@therevills

I've tested you app on my Android device (I've too an LG Optimus one, an the app is very smooth)

Only one thing: how do you play it? Tilting the device forces a change on the screen-layout too... not very handy!

I've made this app for test - it should move a ball based on the accelerometers... (tested on V30... downloading now V31)
of course you need a 'ball.png' in the name.data folder


ps: I tried to compile my app and install it over the old one (as they have the same MonkeyGame.apk)
AndroidOS tells me that the install will write the previous up... but then I get an error: I need to manually uninstall the previous one and then install the last one.
Did you have the same behaviour?

(I will post this on the monkey.forum too)

Cheers


therevills(Posted 2011) [#7]
The movement is very erratic for 5 seconds or so before things settle down


I get that kind of behaviour when playing Angry Birds :/

There is no OnOrientationChanged() (or GetOrientation() function)


I believe (but dont quote me :P) is that you can do this yourself in the build files Monkey generates.

Mark has release recently v31 just includes: "Added OnSuspend/OnResume - XNA/iOS/Android only for now" - I havent played around with them yet.

HTML-5 version is performing better than the Flash version


I think its all due to the browser and PC - if the Flash and HTML5 were on different pages you might see Flash being better...

Tilting the device forces a change on the screen-layout too... not very handy!


The idea is that it is meant to be played landscape mode and you tilt left and right to move the left bat... but yeah the auto layout thing messes it up... need to find a way to stop that! :P

Last edited 2011


EOF(Posted 2011) [#8]
You can edit the Android projects manifest file * to lock orientation as desired. Weapons of choice being:
android:screenOrientation="portrait"
android:screenOrientation="landscape"
android:screenOrientation="portrait|landscape"
* My understanding is Monkey only creates the manifest once and will not overwrite any changes when you re-compile

Last edited 2011


therevills(Posted 2011) [#9]
Thanks Jim... just found this out myself:

<activity android:name="MonkeyGame"
          android:label="@string/app_name"
          android:screenOrientation="landscape"
          android:theme= "@android:style/Theme.NoTitleBar.Fullscreen">


This forces landscape and fullscreen.


Just uploaded a new Android version with fullscreen and landscape mode.

Last edited 2011


EOF(Posted 2011) [#10]
Nice
Now if you use AccelX() instead of AccelY() it will make more sense for controlling the paddle. Thus, tilting the phone forwards and backwards (whilst in landscape) will make to paddle move as expected

Could you stick an FPS indicator on screen? It might make for a handy reference as to performance

Have you tried sound on your LG? Any luck?


EDIT
I read your query over at Monkey forums about keeping the screen awake. This is a power management thing and should be created and released in a friendly manor. One for Mark?
Example:

Function OnCreate()
   PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
   PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "My Tag");
   wl.acquire()
End

Function OnSuspend()
  wl.Release()
End Function

Also, the manifest would need:
<uses-permission android:name="android.permission.WAKE_LOCK" />

Last edited 2011


therevills(Posted 2011) [#11]
Uploaded new versions with sound and a new font (thanks degac!).

Also added FPS and changed the controls just for Jim!


EOF(Posted 2011) [#12]
Thanks. Sound works on my Galaxy S. 35FPS

I am hoping Mark implements a proper "App suspend" system now. Your example still runs in the background (complete with sound effects) when the HOME key is pressed. I see Mark is aware of this though

He is right in what he says, an app does not have to 'close'. However, when suspended all related sound, timers, and the use of the accelerometer must be suspended too

Last edited 2011


therevills(Posted 2011) [#13]
Ouch! 35FPS!!!

On my Optimus One it runs 56FPS - 60FPS... and thats with the slower processor...

Which Galaxy S have you got?

http://www.gsmarena.com/results.php3?sQuickSearch=yes&sName=Galaxy+S


EOF(Posted 2011) [#14]
Galaxy S I9000 with custom 'fast' ROM - Darky's Extreme edition
I get top scores on the Quandrant test - 1518 (which beats all currently listed phones)

Other 2D games run fast - HyperJump, Angry Birds, Space Physics, Stupid Zombies

I don't know why I only get 35 FPS for your example?
Perhaps its something to do with the accelerometer polling rate


therevills(Posted 2011) [#15]
Just tested Mark's example Touch Test. I removed the command to create sparks on touch, so it always generates a spark - but as soon as you touch the screen you can see that it slows down...