Jump to content



0

Enemy random movement


3 replies to this topic

#1 boski OFFLINE  

boski

    Space Invader

  • 13 posts
  • Location:Janesville, WI

Posted Thu Sep 1, 2011 8:09 PM

This game is still in the relatively early stages of development. I want to get the enemy movements down, though, before I go any further. I've got a three level playing field, and I want the enemy to patrol it. Whenever he hits the edge of the screen, I want him to reappear at a random side of a random level. So six possible outcomes. Unfortunately, he only wants to appear at about three of the options, and he often gets stuck. I can't quite figure this one out, so if someone could take a quick look for me, I'd really appreciate it. Thanks!

Attached Files



#2 ScumSoft OFFLINE  

ScumSoft

    Moonsweeper

  • 331 posts
  • Location:Polysorbate 60

Posted Thu Sep 1, 2011 9:33 PM

I'm on it, however I am doing a rewrite of most your routines to make them more clear. Also writing up some instructional tutorial text in there to help out.

#3 ScumSoft OFFLINE  

ScumSoft

    Moonsweeper

  • 331 posts
  • Location:Polysorbate 60

Posted Thu Sep 1, 2011 11:41 PM

Ok this should be a good example to get things going properly, your guy has 16 possible exit locations actually.
Also I would not bother with the background as multicolored playfields look far nicer I think :)
but to each his own.

Hope this helps!

[edit]There are a couple typos in there, nothing major.
Change 
  if !GFXtimer then goto skip_enemy_reverse 
to
  if !GFXtimer{1} then goto skip_enemy_reverse 
That line is meant to slow down the motion of the enemy to every 3 frames

Attached Files


Edited by ScumSoft, Fri Sep 2, 2011 3:17 PM.


#4 boski OFFLINE  

boski

    Space Invader

  • 13 posts
  • Location:Janesville, WI

Posted Fri Sep 2, 2011 8:36 AM

Oh wow! Thank you so much! I really appreciate it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users