Jump to content



0

BASIC question


2 replies to this topic

#1 atari2600land ONLINE  

atari2600land

    Quadrunner

  • 6,496 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Sat Oct 29, 2011 10:51 PM

OK, I am making this program where you're moving a thing across the screen. What I want to do is figure out whether or not the thing moving hits a dot (it's like pac-man) and if so, add one to the score. Basically, what I want to do is like so (which is not valid BASIC):
IF PLOT D,E,"." THEN H=H+1
Well, can you help?

Attached Thumbnails

  • puckman2a.png


#2 DanBoris OFFLINE  

DanBoris

    Dragonstomper

  • 930 posts
  • Location:New Jersey, USA

Posted Tue Nov 1, 2011 10:45 AM

I am not entirely clear what your question is, and for a proper answer I would need to know what Basic you are using on what kind of system.

If you are asking about collision detection, then the simplest way is to determine the coordinates of a sqaure that encloses your "thing" and compare this to the coordinates of a square that encloses your dot to see if the two squares interesect. If they do, then increment your score.

Dan

#3 atari2600land ONLINE  

atari2600land

    Quadrunner

  • 6,496 posts
  • All hail the zyzzyva!
  • Location:Salem, Oregon

Posted Tue Nov 1, 2011 6:09 PM

What I'm asking is, when you look at the screenshot above, there are a whole bunch of dots, right? What I want to know is how would I increment the score once a dot is eaten and not when a dot isn't eaten. I'm using Oric by the way.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users