WIP: Invaders

Monkey Archive Forums/Monkey Projects/WIP: Invaders

therevills(Posted 2011) [#1]
In HTML5/Flash and Android:

http://www.therevillsgames.com/monkey/invaders/invaders.html

Using the great Xenon 2000 graphics :)


therevills(Posted 2011) [#2]
Slight update....

Invaders... now contains Invaders :P

This has really slowed the Android version down some what!!! I now get 25-30FPS when playing... (before the Invaders were added I was getting 50+FPS).




degac(Posted 2011) [#3]
well... I get 15-25 FPS on my Android LG Optimus ONe.... 30 fps with only one alien on screen!

edit:

Can you test your app REMOVING the DrawText commands (score, level, fps) to see the 'impact' of this command?
Maybe replacing with one single image the words 'score level fps' could gain something.

And setting up the refresh rate to another value?


DruggedBunny(Posted 2011) [#4]
I got slowed down greatly by my 'dumb' collision detection, ie. comparing all shots against all blocks in the case of RockOut. Have to get to grips with shifted-grid or some other, smarter, collision method!


therevills(Posted 2011) [#5]
@degac - will try without the drawtext tonight. Ive got the refresh rate set to 60, what should I try?

@James - whats shifted-grid?

Im doing my comparing like this:
For local b:Bullet = Eachin Bullet.list
   For local a:Alien = Eachin Alien.list
      if b.Collide(a)
         'kill alien
      Endif
   Next
Next



SinisterSoft(Posted 2011) [#6]
You could improve it by breaking out of the inner loop if you have hit an alien.


DruggedBunny(Posted 2011) [#7]
Here's some shifted grid info -- note that I only half understand it, not having sat down and read it properly, which is why my own recent half-assed go-it-alone attempt to implement it failed!

The theory is that you stick your aliens and shots into the squares of a grid, so you're only comparing "aliens in this square" against "bullets in this square", rather than all aliens against all bullets.


Warpy(Posted 2011) [#8]
Or if you're a real mathmo you use a quadtree!


therevills(Posted 2011) [#9]
@SinsterSoft - Yep Im already doing that, just didnt put it in that bit of code - Thanks!

@James - Ahhh, Ive done something like this when I was trying to do a worms clone in BlitzMax, when trying to alter the map in realtime.

@Warpy - Well thats not me then... Ill leave it to you :P


Xaron(Posted 2011) [#10]
Great! :)

After passing level 12 with the flash version I can't lose anymore because the invaders move that fast they can't hit me anymore. ;) They are just on the left and right border. I stopped playing at level 32. :D