Jump to content
IGNORED

missile0 not dissapearing


Retro Lord

Recommended Posts

I have some problems with making missile0 dissapear after the firebutton has been pressed. The idea is that missile0 appears at either left or right depending on which direction the joystick is pushed and the firebutton is pressed. I managed too get this part too work. But, I can't figure out how to make it stay for 1 second and then dissapear. I tried adding a counter that starts at 0 and then goes up too 10, and when it hits 10 missile0x and y is set too 200 but that just made missile0 never come at all. Any simple tip on how to set this up?

 

My basic missile0 setup is:

 
 if joy0right && joy0fire then k = 1
 if joy0left && joy0fire then k = 2

if k=1 then missile0x=player0x + 10 : missile0y=player0y - 6
 if k = 2 then missile0x=player0x - 10 : missile0y=player0y - 6

Thanks in advance.

 

Gamecode: Lonks Adventure.bas

Link to comment
Share on other sites

Update: I managed too find a pretty clever solution I think:

 if missile0y<200 && joy0right then missile0y=200 : missile0x = 200 : k=0
 if missile0y<200 && joy0left then missile0y=200 : missile0x = 200 : k=0

Now the "sword" (aka, missile0) dissapears if you move after you've swung it. I feel clever, hehe...

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...