Jump to content
IGNORED

Pfpixel on / off?


Captain Spazer

Recommended Posts

Generic question about games like breakout and the like. How do I go about making something like that? When a ball or missile collides with a pfpixel it turns off. Do I do something like this?

 

I defined a wall like this:

 rem player1 wall
 pfpixel  30 1 on
 pfpixel  30 2 on
 pfpixel  30 3 on
 pfpixel  30 4 on
 pfpixel  30 5 on
 pfpixel  30 6 on
 pfpixel  30 7 on
 pfpixel  30 8 on
Link to comment
Share on other sites

Thanks. It's a bit tricky but I'll figure it out eventually. Basically from what I understand, I need dim _pf_x = t, dim _pf_y = u in order to check for the playfields x and y values, and do the same for my ball object, and if my ball object collides with the playfield the game would check the x and y values and if it's a hit then pfpixel _pf_x _pf_y off. Am I somewhat getting it? =)

Link to comment
Share on other sites

Thanks. It's a bit tricky but I'll figure it out eventually. Basically from what I understand, I need dim _pf_x = t, dim _pf_y = u in order to check for the playfields x and y values, and do the same for my ball object, and if my ball object collides with the playfield the game would check the x and y values and if it's a hit then pfpixel _pf_x _pf_y off. Am I somewhat getting it? =)

You can dim using any variables. Those are just the ones I chose. You convert the coordinates of the object you're using as the ball to playfield coordinates, then figure out which two playfield pixels need to be turned off.

Link to comment
Share on other sites

Hm, I can't quite figure it out, could I trouble you for a simpler example? Something with just the bare minimum, like just some blocks, a player that shoots when joy0fire is pressed and with just the calculations for a pfpixel collision?

 

EDIT

This is what I gathered from the breakout example. I'm not getting any errors but I don't get any pixels dissapearing either, am I on the right track atleast?

   pfhline 0 2 31 on

 dim _pf_x = t
 dim _pf_y = u

 dim _M0_x = missile0x.s
 dim _M0_y = missile0x.r

main

drawscreem

 if _pf_x = _M0_x && _pf_y = _M0_y then pfpixel 3 1 off


 goto main
Edited by Captain Spazer
Link to comment
Share on other sites

See if this is any better:

 

randomterrain.com/atari-2600-memories-batari-basic-commands.html#ex_shoot_pfpixel

 

I used pfheights to squish down the pfpixels. If you use the larger default pfpixels, you'll probably need to divide by 8 and subtract based on the height of the object. I just play with the code until it works.

 

I also made a quick one where you can shoot the default size pfpixels:

 

randomterrain.com/atari-2600-memories-batari-basic-commands.html#ex_sprite_missile_pfpixel_destruction

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