KEYTEST.jpg 69K
12 downloadsI was trying to make a "running man" jump, either with a keypress or with CALL JOYST. Now, I have a running man that can move about on screen, one program with key input another with joystick. It was adapted from the Millers Sprites book, and there is another better key input jump version written by Jacques. Some games jump in an arc in the direction you are facing, I think a few just go straight up and back down, and some go up and you can influence the jump slightly left or right with the joystick. At least on arcade games.The problem is, the jump is not nice and clean and seems to mess up on the way down. I was going more for a "Major Havoc" style jump that you hold the jump button down, rather than the mario jump where you tap it and he does a little jump. It has gotten so confusing between the 3 programs, key input for R,C and SPRITE locations DR,DC that it is hard to tell what's what anymore.
Here is the code if anyone has any suggestions or knowledge on this.
10 !JACQUES JUMP SUB
50 ! SAVE DSK1.JUMP
100 CALL CHAR(110,"9898FF197848C80C")
110 CALL CHAR(104,"18187E5A5A18183C")
120 CALL CHAR(107,"9898FF1918784FC1")
130 CALL CHAR(108,"1919FF98181EF283")
140 CALL CHAR(105,"1919FF981E121330")
150 CALL CHAR(117,"1919FF981E121330")
160 CALL CHAR(111,"18187E5A5A18183C")
170 CALL CHAR(114,"1858587F19382E62")
180 CALL CHAR(115,"18183C5F983C4466")
190 CALL CHAR(112,"9898FF197848C80C")
195 CALL CHAR(123,"00")
200 CALL CLEAR :: CALL COLOR(2,7,7) :: CALL SCREEN(11) :: CALL HCHAR(24,1,40,64)!:: CALL VCHAR(1,31,40,96)
210 R,C=10 :: DR,DC=73 :: CALL SPRITE(#1,42,2,DR,DC)
220 CALL KEY(1,K,S) :: IF(K>6 AND K<14)-(K=1 OR(K>15 AND K<18)OR K=19)THEN 220
230 Y=(K>3 AND K<7)-(K=0 OR K=15 OR K=14) :: X=(K=2 OR K=4 OR K=15)-(K=3 OR K=6 OR K=14) :: KK=K
240 IF K=18 THEN CALL JUMP(C,DR,DC)
250 CALL PAT(KK)
280 CALL GCHAR(R+Y,X+C,CH) :: IF CH=40 THEN CALL SOUND(-60,110,9) :: GOTO 220
285 C=C+X :: R=R+Y :: IF C<2 THEN C=30 ELSE IF C>30 THEN C=2
288 DR=R*8-7 :: DC=C*8-7
290 CALL LOCATE(#1,DR,DC)
300 GOTO 220
1000 SUB JUMP(C,DR,DC) :: SDR=DR
1010 CALL KEY(1,K,S) :: IF K=18 THEN DR=DR-4 :: DC=DC+1 :: IF DC>240 THEN DC=1
1020 IF DR<8 THEN 1040
1030 CALL LOCATE(#1,DR,DC) :: CALL PAT(KK) :: IF S<0 THEN 1010
1040 IF DR<SDR THEN DR=DR+4 :: DC=DC+1 :: CALL LOCATE(#1,DR,DC) :: IF DC>240 THEN DC=1
1050 CALL PAT(KK) :: IF DR<SDR THEN 1040
1060 C=INT((DC+7)/
2000 SUB PAT(KK) :: CALL PATTERN(#1,KK+105)
2010 FOR I=1 TO 10 :: NEXT I
2020 CALL PATTERN(#1,KK+112)
2030 FOR I=1 TO 10 :: NEXT I
2090 SUBEND
-----------------------------------------------------------------------
KEYTEST
100 CALL CHAR(110,"9898FF197848C80C")
110 CALL CHAR(104,"18187E5A5A18183C")
120 CALL CHAR(107,"9898FF1918784FC1")
130 CALL CHAR(108,"1919FF98181EF283")
140 CALL CHAR(105,"1919FF981E121330")
150 CALL CHAR(117,"1919FF981E121330")
160 CALL CHAR(111,"18187E5A5A18183C")
170 CALL CHAR(114,"1858587F19382E62")
180 CALL CHAR(115,"18183C5F983C4466")
190 CALL CHAR(112,"9898FF197848C80C")
200 CALL CLEAR :: CALL COLOR(2,7,7) :: CALL SCREEN(11) :: CALL HCHAR(24,1,40,64) :: CALL VCHAR(1,31,40,96) :: CALL SPRITE(#1,42,2,153,33) :: R=20 :: C=5
210 CALL KEY(1,K,S) :: IF((K>6 AND K<14)OR K=18)-(K=1 OR(K>15 AND K<18)OR K=19)THEN 210
220 Y=(K>3 AND K<7)-(K=0 OR K=15 OR K=14) :: X=(K=2 OR K=4 OR K=15)-(K=3 OR K=6 OR K=14)
225 IF DR=1 THEN DR=DR-1 :: IF R=0 THEN R=R+1
230 DISPLAY AT(22,1):"KEY=";K+105
240 CALL PATTERN(#1,K+105)
250 FOR I=1 TO 10 :: NEXT I
260 !ISPLAY AT(23,1):"KEYB= ";K-104
270 CALL PATTERN(#1,K+112)
280 !ISPLAY AT(23,1):"KEYC= ";K-110
290 CALL GCHAR(R+Y,X+C,CH) :: IF CH=40 THEN CALL SOUND(-60,110,9) :: GOTO 210 ELSE C=C+X :: R=R+Y :: DR=R*8-7 :: DC=C*8-7
292 CALL LOCATE(#1,DR,DC)
295 CALL KEY(1,K,S) :: IF K=18 THEN CALL JUMP(C,DR,DC)
297 GOTO 210
300 SUB JUMP(C,DR,DC)
303 CALL POSITION(#1,DR,DC) :: CALL LOCATE(#1,DR,DC)
307 T=T+1
310 CALL LOCATE(#1,DR-T,DC)!UP
315 CALL KEY(1,K,S) :: IF K=18 THEN GOTO 307
317 CALL POSITION(#1,SR,SC)!FINDSTARTOFJUMP
330 CALL LOCATE(#1,DR+1,DC)!DOWN
335 !F DR<>SR THEN GOTO 330
340 CALL KEY(1,K,S) :: IF K=-1 THEN GOTO 330
350 SUBEND
Attached Files
Edited by orion1052003, Sat Sep 10, 2011 5:47 PM.













