Videopac / Odyssey2 forum
September 27, 2021, 09:32:35 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Join Rafael's Haunted Woods contest and win a copy of the game!
 
   Home   Help Login Register links videopac.nl  
Pages: [1]   Go Down
  Print  
Author Topic: Collision detection help  (Read 300 times)
Chris!
Give this man a Jopac!
******
Posts: 1232



WWW
« on: July 15, 2021, 08:00:49 AM »

So I have this sprite, and I want him to land on the minus sign (which I'm using as a platform.) I tried experimenting for hours trying to find the correct thing, but I can't do it. I have this code:
Code:
movx a,@r0 ; get Y pos of minus sign
mov r7,a
movx a,@r1 ; get Y pos of sprite
cpl a ; make negative
inc a
add a,r7 ; calculate the difference
add a,#002h ; add offset (a sprite pixel is two lines)   help!
add a,#0d2h ; determine sprite distance                   help!
jc nope2              ; if not landed properly, then return out of this code.
The sprite is your standard 8x8 pixel sprite. The two lines I need help on are marked.
Also, while I have your attention, is there an Odyssey 2 discord page?
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
TedFoolery
Attacked the Timelord
***
Posts: 101


« Reply #1 on: July 15, 2021, 05:57:28 PM »

replacing those two adds with just "add a,#0f4h" worked for me
Logged
Chris!
Give this man a Jopac!
******
Posts: 1232



WWW
« Reply #2 on: July 16, 2021, 05:10:06 AM »

In this game the screen scrolls up when the guy moves up to a new one and the guy is continually jumping. While the screen scrolls up, sometimes when the guy is on the edge of a platform, he bounces up and down on it and then he falls down to his death when it scrolls up. I attached the code here so you can look at it.
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!