|
Post by aka on Mar 27, 2006 20:40:55 GMT -5
Hi I have been studying the source code for Galaxian and this small game made by RedAngel to get an idea of how to make simple games topic and source code posted here devster.proboards22.com/index.cgi?board=basiegaxorz&action=display&thread=1110995489And I'm still alitte confused on how to move the ship sprite with my keyboard............... Can someone explain the different ways that I can move my sprite [sprites] what I mean is in some games I what to use all dierctions and A,B and C buttons and in others I what to scroll left and right like in Galaxian and shot with the A button............... Here's the source code pallettes pallette1,0,0,15 loadtiles sprites,1,64 ship=addsprite(1,1) propsprite ship,64,0 movesprite ship,128,128 joypad: j=joypad() if j.2 then shiftsprite ship,1,0 if j.3 then shiftsprite ship,-1,0 sprites: DATALONG $00033000 '1:ship DATALONG $00033000 DATALONG $00355300 DATALONG $30311303 DATALONG $30311303 DATALONG $33522533 DATALONG $35244253 DATALONG $00000000 pallette1: DATAINT $0000,$0E22,$0AAA,$0444,$0EA0,$0888,$0000,$0000 DATAINT $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
But this had no effect on the sprite Any help is appreciated ;D ;D Thanks
|
|
|
Post by aka on Mar 28, 2006 4:29:16 GMT -5
I figured it out here's the new code ;D
pallettes pallette1,0,0,15 loadtiles sprites,1,64 ship=addsprite(1,1) propsprite ship,64,0 movesprite ship,286,340 while 1 shiftsprite ship,0,0 sleep 1 joypad: j=joypad() if j.2 then shiftsprite ship,-3,0 if j.3 then shiftsprite ship,3,0 if j.0 then shiftsprite ship,0,-3 if j.1 then shiftsprite ship,0,3 sprites: DATALONG $00033000 '1:ship DATALONG $00033000 DATALONG $00355300 DATALONG $30311303 DATALONG $30311303 DATALONG $33522533 DATALONG $35244253 DATALONG $00000000 pallette1: DATAINT $0000,$0E22,$0AAA,$0444,$0EA0,$0888,$0000,$0000 DATAINT $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
wend
I am very happy now ;D ;D ;D
Peace
|
|