D-Bug & Automation Forum
D-Bug & Automation Forum >> Coding >> Sauron's homework! (assignment #1 - bouncy)
https://d-bug.mooo.com/dbugforums/cgi-bin/yabb2/YaBB.pl?num=1304238634

Message started by ggn on 01.05.11 at 08:30:33

Title: Re: Sauron's homework! (assignment #1 - bouncy)
Post by Sauron on 04.05.11 at 02:54:01
The interaction wasn't really a problem so much, that was probably the easier part of this. What I'm running into right now is translating the game logic into 68k asm. Looking at the Downfall source, this is the relevant bit to testing the borders of the screen:

[code]
cmp.l      #240,player_y                        ; are we at the bottom of the screen?
bgt            gameover                        ; GAME OVER PLAYER ONE
cmp.l      #17,player_y                        ; are we at the top of the screen?
blt            gameover                              ; GAME OVER PLAYER ONE
                       
moveq      #0,d7                                    ; pad movement flag (0=no movement)

move.l      #-1,falling                              ; man falling flag (-1 = falling)[/code]

So obviously what I need to change is the branch to gameover, for one, since hitting the top or bottom border will necessitate a change in direction of the player object (the ball). What I need to add in is this:

- Movement code for the ball
- testing left and right borders
- changing direction of ball when any borders are hit

I'm running into a mental block, and having to find the appropriate instructions on a 68k cheat sheet will always make me hate life.  ;D

D-Bug & Automation Forum » Powered by YaBB 2.6.0!
YaBB Forum Software © 2000-2022. All Rights Reserved.