Jump to content
Sign in to follow this  
Captain Spazer

I can place pfpixels, but not remove them

Recommended Posts

Im having a bit of trouble with my code for a map maker, I can make the player place blocks, but not remove them, any ideas on how to do that?

 x = (missile0x-18)/4 : y = (missile0y)/8
 x = (missile0x-18)/4 : y = (missile0y)/8
 if joy0fire && collision(playfield,missile0) then pfpixel x y off
 if joy0fire then pfpixel x y on

I figured it out... I just had to swap places with these 2 lines:

 if joy0fire then pfpixel x y on
 if joy0fire && collision(playfield,missile0) then pfpixel x y off
Edited by Captain Spazer

Share this post


Link to post
Share on other sites

How I would do this would be

 

if joy0fire && !a{0} then a{0}=1
if !joy0fire && a{0} then pfpixel x y flip : a{0}=0

the a{0} is needed as a flag to make sure whether the joy0fire is pressed or not. !=unpressed.

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...