Jump to content
Sign in to follow this  
boski

Enemy random movement

Recommended Posts

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!

balloon prot.bas

Share this post


Link to post
Share on other sites

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.

  • Like 1

Share this post


Link to post
Share on other sites

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

balloon.bas

balloon.bin

Edited by ScumSoft
  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...