-
Content Count
348 -
Joined
-
Last visited
-
Days Won
1
Posts posted by orion1052003
-
-
After much confusion, I got the coincidences to register a sound both in the main and in the sub with meteor. Put the coinc check in the jump loop. 2 different coinc sounds to help make it easier to see which coincidence check is working, called from main or called from sub. plus you see it hit the meteor when jumping and make a sound, when testing.
635 DR=130 :: DC=1
640 CALL SPRITE(#1,96,16,DR,DC) :: CALL MAGNIFY(4)
650 CALL METEOR
660 ANIM=ABS(ANIM-4) :: CALL JOYST(1,X,Y) :: DR=DR-Y*0 :: DC=DC+X*4 :: CALL LOCATE(#1,(DR AND 255)+1,(DC AND 255)+1)
661 CALL COINC(ALL,HIT) :: IF HIT THEN 662 ELSE 663
662 CALL SOUND(300,-1,10) :: CALL DELSPRITE(#1)
663 CALL KEY(1,K,S) :: IF K=18 THEN CALL JUMP(DR,DC,FACE,HIT)
664 IF X<>0 THEN CALL PATTERN(#1,ANIM+X*2+108) :: FACE=SGN(X+4) :: GOTO 660
665 CALL PATTERN(#1,FACE*16+96) :: GOTO 660
670 IF DC<2 THEN DC=240 ELSE IF DC>240 THEN DC=2
810 SUB JUMP(DR,DC,FACE,HIT)
840 SDR=DR :: A=1
845 IF DC<2 THEN DC=240 ELSE IF DC>240 THEN DC=2
850 CALL KEY(1,K,S) :: IF K=18 THEN DR=DR-4 :: DC=DC+(A*PI/45)*5 :: IF DC>240 THEN DC=1
855 CALL COINC(ALL,CO) :: IF CO THEN CALL SOUND(150,-2,4)
860 !DISPLAY AT(23,1):A;" ";SIN(A*PI/45)
870 IF DR<8 THEN 890
880 CALL LOCATE(#1,DR,DC) :: IF S<0 THEN A=A+1 :: GOTO 850
890 IF DR<SDR THEN DR=DR+4 :: DC=DC+1 :: CALL LOCATE(#1,DR,DC) :: IF DC>240 THEN DC=1
900 IF DR<SDR THEN 890
910 SUBEND
920 SUB METEOR
925 CALL COLOR(6,16,2)
930 M$="00000000000F10204980A0829041221C0000000000C020A02020204080000000"
935 CALL CHAR(72,M$) :: DR=169 :: DC=1
940 CALL SPRITE(#2,72,16,DR,DC,20,-20)
960 !OR I=1 TO 100 :: NEXT I
970 SUBEND
-
Oh, ok. I gotta check this out. Last time I ran it, there were no errors, the meteor just flies by and passes over the man without a coincidence like you said in the above.
-
It was supposed to be :
850 CALL KEY(1,K,S) :: IF K=18 THEN DR=DR-4 :: IF FACE=1 THEN DC=DC+(A*PI/45)*5 :: IF FACE=0 THEN DC=DC-(A*PI/45)*5 :: IF DC>240 THEN DC=1
I remember changing 1 line to FACE=1 and one to FACE=0 and it still didn't come out right. Wow. If this isn't murphy's law, it's definitely what happens when it gets late at night. Some days I can't do this till night and am fighting sleep.
-
Thanks. This code with a man and a meteor didn't work. I will read pages 180 and 181 again. I tried to pass the variable C.
635 DR=130 :: DC=1
640 CALL SPRITE(#1,96,16,DR,DC) :: CALL MAGNIFY(4)
650 CALL METEOR©
662 CALL COINC(#1,#2,10,C) :: CALL KEY(1,K,S) :: IF K=18 THEN CALL JUMP(DR,DC,FACE)
663 IF X<>0 THEN CALL PATTERN(#1,ANIM+X*2+108) :: FACE=SGN(X+4) :: GOTO 660
920 SUB METEOR©
925 CALL COLOR(6,16,2)
930 M$="00000000000F10204980A0829041221C0000000000C020A02020204080000000"
935 CALL CHAR(72,M$) :: DR=169 :: DC=1
940 CALL SPRITE(#2,72,16,DR,DC,20,-20)
950 CALL COINC(#1,#2,10,C) :: IF C THEN CALL DELSPRITE(#1)
955 CALL POSITION(#2,DR,DC) :: IF DR=130 THEN CALL DELSPRITE(#2)
960 !OR I=1 TO 100 :: NEXT I
970 SUBEND
-
Also tried changing line 850 which makes it jump straight up and to the right on the way down. Misunderstanding is complete again.
635 DR=130 :: DC=1
640 CALL SPRITE(#1,96,16,DR,DC) :: CALL MAGNIFY(4)
660 ANIM=ABS(ANIM-4) :: CALL JOYST(1,X,Y) :: DR=DR-Y*0 :: DC=DC+X*4 :: CALL LOCATE(#1,(DR AND 255)+1,(DC AND 255)+1)
662 CALL KEY(1,K,S) :: IF K=18 THEN CALL JUMP(DR,DC,FACE)
663 IF X<>0 THEN CALL PATTERN(#1,ANIM+X*2+108) :: FACE=SGN(X+4) :: GOTO 660
665 CALL PATTERN(#1,FACE*16+96) :: GOTO 660
670 IF DC<2 THEN DC=240 ELSE IF DC>240 THEN DC=2
810 SUB JUMP(DR,DC,FACE)
815 !ALL COINC(#1,ALL,C)
820 CALL SOUND(150,-2,4)
840 SDR=DR :: A=1
845 IF DC<2 THEN DC=240 ELSE IF DC>240 THEN DC=2
850 CALL KEY(1,K,S) :: IF K=18 THEN DR=DR-4 :: IF FACE=1 THEN DC=DC+(A*PI/45)*5 :: IF FACE=1 THEN DC=DC-(A*PI/45)*5 :: IF DC>240 THEN DC=1
860 !DISPLAY AT(23,1):A;" ";SIN(A*PI/45)
870 IF DR<8 THEN 890
880 CALL LOCATE(#1,DR,DC) :: IF S<0 THEN A=A+1 :: GOTO 850
890 IF DR<SDR THEN DR=DR+4 :: DC=DC+1 :: CALL LOCATE(#1,DR,DC) :: IF DC>240 THEN DC=1
900 IF DR<SDR THEN 890
910 SUBEND
-
I removed line 830 which removed the variable Y from the jump. It now does a jumping effect always going to the right. I would use FACE to tell the program to jump left or right. Line 850 .....IF FACE=1 THEN DC=DC+(A*PI/45)*5 :: IF FACE=0 THEN DC=DC-(A*PI/45)*5?
635 DR=130 :: DC=1
640 CALL SPRITE(#1,96,16,DR,DC) :: CALL MAGNIFY(4)
660 ANIM=ABS(ANIM-4) :: CALL JOYST(1,X,Y) :: DR=DR-Y*0 :: DC=DC+X*4 :: CALL LOCATE(#1,(DR AND 255)+1,(DC AND 255)+1)
662 CALL KEY(1,K,S) :: IF K=18 THEN CALL JUMP(DR,DC)
663 IF X<>0 THEN CALL PATTERN(#1,ANIM+X*2+108) :: FACE=SGN(X+4) :: GOTO 660
665 CALL PATTERN(#1,FACE*16+96) :: GOTO 660
670 IF DC<2 THEN DC=240 ELSE IF DC>240 THEN DC=2
810 SUB JUMP(DR,DC)
815 !ALL COINC(#1,ALL,C)
820 CALL SOUND(150,-2,4)
840 SDR=DR :: A=1
845 IF DC<2 THEN DC=240 ELSE IF DC>240 THEN DC=2
850 CALL KEY(1,K,S) :: IF K=18 THEN DR=DR-4 :: DC=DC+(A*PI/45)*5 :: IF DC>240 THEN DC=1
860 !DISPLAY AT(23,1):A;" ";SIN(A*PI/45)
870 IF DR<8 THEN 890
880 CALL LOCATE(#1,DR,DC) :: IF S<0 THEN A=A+1 :: GOTO 850
890 IF DR<SDR THEN DR=DR+4 :: DC=DC+1 :: CALL LOCATE(#1,DR,DC) :: IF DC>240 THEN DC=1
900 IF DR<SDR THEN 890
910 SUBEND
-
I couldn't get CALL COINC to work with my subprograms, but it worked here in this test on line 365.
100 !TEST PROGRAM-USE CALL LOCATE WITH JOYST
110 P1=15 :: P2=10
120 CALL CLEAR :: CALL SCREEN(6)
130 A$=RPT$("F",16) :: CALL CHAR(96,A$)
140 CALL SPRITE(#1,96,2,89,121)
143 S$=RPT$("F",16) :: CALL CHAR(104,S$)
145 CALL SPRITE(#2,104,16,57,223)
150 DR=100 :: DC=100
160 CALL HCHAR(1,16,104)!UP
170 CALL HCHAR(24,16,112)!DOWN
180 CALL HCHAR(12,3,120)!LEFT
190 CALL HCHAR(12,30,128)!RIGHT
200 CALL JOYST(1,X,Y)
210 CALL COLOR(10,P1,P1,11,P1,P1,12,P1,P1,13,P1,P1)
220 R=R-Y/4 :: C=C+X/4
230 DR=DR-Y*4 :: DC=DC+X*4
260 CALL LOCATE(#1,DR,DC)
270 CALL KEY(1,K,S)
280 DISPLAY AT(16,1):"SAME KEY=0 NEW KEY=1 NO KEY PRESS=-1"
290 DISPLAY AT(18,5):"KEY= ";K;"STATUS= ";S
300 DISPLAY AT(20,1):"X= ";X;"Y= ";Y
310 DISPLAY AT(21,1):"R= ";R;"C= ";C
320 DISPLAY AT(22,1):"DR= ";DR;"DC= ";DC
330 IF Y=4 AND X=0 THEN CALL COLOR(10,P2,P2)
340 IF Y=0 AND X=4 THEN CALL COLOR(13,P2,P2)
350 IF Y=-4 AND X=0 THEN CALL COLOR(11,P2,P2)
360 IF Y=0 AND X=-4 THEN CALL COLOR(12,P2,P2)
365 CALL COINC(#1,#2,10,C) :: IF C THEN CALL SOUND(300,-2,10)
368 DISPLAY AT(14,12):"C= ";C
370 GOTO 200
-
Do you have to put several CALL COINC statements in to make it catch a coincidence? Or do you generally just write one CALL COINC and loop back to it?
Do you need to CALL subrprograms in the same loop as CALL JOYST(main program)?
I suppose the CALL JOYST would be the main game loop. How do I work in the Subprograms without making the JOYST loop way too lengthy?
I was planning to have a few separate subroutines CALL enemies(Subprograms) one at a time in a loop continuously until the game ends. I think this would cause a similar effect to the recurring and annoying bouncing Spider in Centipede.
THe JUMP was written by my friend who was also experimenting with PI. We wanted to make a jump using CALL LOCATE instead of the normal CALL MOTION, primarily because I heard using locate is much better for coincidence checking. Instead of the internet, most of my news and information comes from rumor and small children, so I'm not sure about that.
-
I think WORKS and ALSO WORKS somehow got pasted twice and I didn't realize it.
In THISWORKS I was trying to find out if a Sprite set up in the Main Program could cause coincidence with another sprite if it was called from a subprogram. I had a lot of trouble understanding Subprograms and getting them to work.
In my text, it was not the copyright symbol, but the parameter ©. C=Coincidence. It think it was a text-edit to browser translation error.
In DOESNOTWORK, I wanted to see if CALL COINC would work when called from within a Subprogram. I tried it passing C for coincidence and without passing C and nothing happened. This seemed to support my thought that CALL COINC might not work within a subprogram until you told me that I just need to loop back to Call Coinc. This kind of strange or unusual nonunderstanding of simple or BASIC concepts, is what I deal with all the time. Since I'm more of a beginner self-taught type, I probably see this stuff in a different and even scattered way, and sometimes I have a hard time understanding this stuff. But I find I pick up more the more time I spend on it.
So I should have kept looping to CALL OBJECT?
-
DR=Dot Row DC=Dot Column Y= Horizontal X=Vertical(whatever JOYST uses)
I think Y*4 is added to DR or subtracted. Line 660.
635 DR=130 :: DC=1
640 CALL SPRITE(#1,96,16,DR,DC) :: CALL MAGNIFY(4)
660 ANIM=ABS(ANIM-4)::CALL JOYST(1,X,Y)::DR=DR-Y*4 :: DC=DC+X*4::CALL LOCATE(#1,DR,DC)
663 IF X<>0 THEN CALL PATTERN(#1,ANIM+X*2+108)::FACE=SGN(X+4)::GOTO 660
16 pixels?
-
At first I had 8 directions and center, Diagonals and LeftRightUpDown. It took almost all the character sets and I thought to try only Left, Right, and Fire for the jump. In the game it seems he doesn't actually need to move up or down, the diagonal jump looked cool..but ya can't have everything. So, yes, left, right, orange button k=18.
My thought or wish on the Major Havoc jump would be to try and emulate this jump but then slow it down a bit. I wanted the man to run at ground level left or right and wrap around the screen.(which he now does) He would jump in a tad slow floating movement as long as the button was held down, or until he hit the "ceiling". I was inspired by Major Havoc and Lunar Lander to have a space man with super high jumps, maybe on a planetoid..
There are about 4 subroutines of enemies that keep re-appearing until the game ends, and they only partially work.
-
I forgot to mention this is an arc jump, and I was planning to change it to a slow, floating, high, "Major Havoc" style jump if I can figure out how to do it. It would keep jumping so long as the button was pressed, and hit the "ceiling", like Lunar Lander.
James
-
Do you have any idea why my jump won't work?
730 CALL KEY(1,K,S)
740 IF K=18 THEN CALL JUMP(DR,DC)ELSE 660
743 IF COUNT=25 THEN CALL ALIEN
745 IF COUNT=100 THEN CALL BLASTOFF
750 IF K<>18 THEN 660!CALL JOYST
760 GOTO 660!CALL JOYST
770 !ENDOFMAINLOOP
810 SUB JUMP(DR,DC)
815 !ALL COINC(#1,ALL,C)
820 CALL SOUND(150,-2,4)
830 DR=DR-Y*4
840 SDR=DR :: A=1
850 CALL KEY(1,K,S) :: IF K=18 THEN DR=DR-4 :: DC=DC+(A*PI/45)*5 :: IF DC>240 THEN DC=1
860 !DISPLAY AT(23,1):A;" ";SIN(A*PI/45)
870 IF DR<8 THEN 890
880 CALL LOCATE(#1,DR,DC) :: IF S<0 THEN A=A+1 :: GOTO 850
890 IF DR<SDR THEN DR=DR+4 :: DC=DC+1 :: CALL LOCATE(#1,DR,DC) :: IF DC>240 THEN DC=1
900 IF DR<SDR THEN 890
-
JOYPROG
200 CALL MOTION(#1,0,0) Makes it a joystick tester without moving the dot.
200 CALL JOYST(1,X,Y):: CALL MOTION(#1,-Y*4,X*4)
240 CALL POSITION(#1,DR,DC)
These 200, 240 also work good. What does the CALL POSITION do in this case? The square is in motion in 200, Line 240 checks its position, then what does it do with that position?
-
It works great. The man wraps around on screen. Why does it work?
640 CALL SPRITE(#1,96,16,DR,DC) :: CALL MAGNIFY(4)
660 ANIM=ABS(ANIM-4) :: CALL JOYST(1,X,Y) :: DR=DR-Y*0 :: DC=DC+X*4 :: CALL LOCATE(#1,(DR AND 255)+1,(DC AND 255)+1)
What does the +1 do?
663 IF X<>0 THEN CALL PATTERN(#1,ANIM+X*2+108) :: FACE=SGN(X+4) :: GOTO 660
665 CALL PATTERN(#1,FACE*16+96) :: GOTO 660
670 IF DC<2 THEN DC=240 ELSE IF DC>240 THEN DC=2!THIS LINE DIDN'T WORK
I am somewhat familiar with AND since I read The Power of AND by Craig Miller from "Night Mission". I think whatever you AND something with, the answer can't be higher than whatever number you ANDed with. The bit "mask" in assembly. I don't fully understand it, but I ANDed some numbers at work just to get familiar with it. I think 9 is 1001. 1 is 0001. 9 AND 1 would be 0001=1 then I think. Can you actually do AND 1, AND 7, etc. or was it some number AND 1, DC, DR, or some number AND 7, etc. that you meant above?
-
Thanks! neat stuff. Tried it out in my own program, seems like it works, too. Now, gotta set some screen edges to wrap horizontally and stop vertically, and make the man jump. Trying to make the man jump something like Major Havoc.
200 L$="00233123213F0303033F20202020E0000080808080F888889888808080FC0404"
210 L2$="0003010B09090F010101011F10101070008080808080F8888880808080FC0404"
220 R$="000303037F43434303030202023E303000880888F880808080F8080808080E0E"
230 R2$="00030303070F172747070707FCFCC0C0008000808080FC000000E0E060607878"
280 C$="000302030F0B1B03030302020202060600808080E0A0B080808080808080C0C0"
290 C2$="000302030F0B1B03030302020202060600808080E0A0B080808080808080C0C0"
420 CALL CHAR(96,C$,100,L$,104,L2$)
440 CALL CHAR(112,C2$,116,R$,120,R2$)
635 DR=130 :: DC=1
640 CALL SPRITE(#1,96,16,DR,DC) :: CALL MAGNIFY(4)
660 ANIM=ABS(ANIM-4)::CALL JOYST(1,X,Y)::DR=DR-Y*4 :: DC=DC+X*4::CALL LOCATE(#1,DR,DC)
663 IF X<>0 THEN CALL PATTERN(#1,ANIM+X*2+108)::FACE=SGN(X+4)::GOTO 660
665 CALL PATTERN(#1,FACE*16+96)::GOTO 660
-
Changed the program a bit according to the suggestions. Seems pretty effective now. Perhaps the movement is still a bit slow. I doubt LOCATE could be as smooth as CALL MOTION.
100 !TEST PROGRAM-USE CALL LOCATE WITH JOYST
110 P1=15 :: P2=10
120 CALL CLEAR :: CALL SCREEN(6)
130 A$=RPT$("F",16) :: CALL CHAR(96,A$)
140 CALL SPRITE(#1,96,2,89,121)
150 DR=100 :: DC=100
160 CALL HCHAR(1,16,104)!UP
170 CALL HCHAR(24,16,112)!DOWN
180 CALL HCHAR(12,3,120)!LEFT
190 CALL HCHAR(12,30,128)!RIGHT
200 CALL JOYST(1,X,Y)
210 CALL COLOR(10,P1,P1,11,P1,P1,12,P1,P1,13,P1,P1)
220 R=R-Y/4 :: C=C+X/4
230 DR=DR-Y*4 :: DC=DC+X*4
260 CALL LOCATE(#1,DR,DC)
270 CALL KEY(1,K,S)
280 DISPLAY AT(16,1):"SAME KEY=0 NEW KEY=1 NO KEY PRESS=-1"
290 DISPLAY AT(18,5):"KEY= ";K;"STATUS= ";S
300 DISPLAY AT(20,1):"X= ";X;"Y= ";Y
310 DISPLAY AT(21,1):"R= ";R;"C= ";C
320 DISPLAY AT(22,1):"DR= ";DR;"DC= ";DC
330 IF Y=4 AND X=0 THEN CALL COLOR(10,P2,P2)
340 IF Y=0 AND X=4 THEN CALL COLOR(13,P2,P2)
350 IF Y=-4 AND X=0 THEN CALL COLOR(11,P2,P2)
360 IF Y=0 AND X=-4 THEN CALL COLOR(12,P2,P2)
370 GOTO 200
-
Added DR,DC=100 and and took the row and column velocity off the CALL SPRITE. Didn't simply the call chars part yet. Now the question is, why does it work? It moves slowly but works now. Thanks.
10 DR,DC=1
20 !TEST PROGRAM-USE CALL LOCATE WITH JOYST
25 P1=15 :: P2=10
30 CALL CLEAR :: CALL SCREEN(6) :: CALL COLOR(9,2,2)
40 A$="FFFFFFFFFFFFFFFF" :: B$="FFFFFFFFFFFFFFFF"
42 C$="FFFFFFFFFFFFFFFF" :: D$="FFFFFFFFFFFFFFFF" :: E$="FFFFFFFFFFFFFFFF"
50 CALL CHAR(96,A$,104,B$,112,C$,120,D$,128,E$)
60 CALL SPRITE(#1,96,2,89,121)
65 DR=100 :: DC=100
70 CALL JOYST(1,X,Y)
75 CALL COLOR(10,P1,6,11,P1,6,12,P1,6,13,P1,6)
80 !=R-Y/4 :: C=C+X/4
90 DR=DR-Y*4 :: DC=DC+X*4
100 !R=INT(R*8-7):: DC=INT(C*8-7)
110 !ALL POSITION(#1,DR,DC)
120 CALL LOCATE(#1,DR,DC)
130 CALL KEY(1,K,S)
140 DISPLAY AT(16,1):"SAME KEY=0 NEW KEY=1 NO KEY PRESS=-1"
145 DISPLAY AT(18,5):"KEY= ";K;"STATUS= ";S
150 DISPLAY AT(20,1):"X= ";X;"Y= ";Y
160 DISPLAY AT(21,1):"R= ";R;"C= ";C
170 DISPLAY AT(22,1):"DR= ";DR;"DC= ";DC
180 CALL HCHAR(1,16,104)!UP
190 CALL HCHAR(24,16,112)!DOWN
195 CALL HCHAR(12,3,120)!LEFT
198 CALL HCHAR(12,30,128)!RIGHT
200 IF Y=4 AND X=0 THEN CALL COLOR(10,P2,6)
210 IF Y=0 AND X=4 THEN CALL COLOR(13,P2,6)
220 IF Y=-4 AND X=0 THEN CALL COLOR(11,P2,6)
230 IF Y=0 AND X=-4 THEN CALL COLOR(12,P2,6)
250 GOTO 70
-
It seems like when you do CALL COINC from a subprogram, you must pass the variable for it to register with an object in a subprogram colliding with an object in the main program.
40 !COINCTEST(WORKS)
50 CALL CLEAR :: CALL SCREEN(3)
60 CALL COLOR(9,2,2,10,11,11)
70 CALL SPRITE(#1,96,2,89,1,0,10,#2,104,11,89,249,0,-10)
80 !ALL OBJECT
90 CALL COINC(#1,#2,10,C)
95 DISPLAY AT(24,1):"C= ";C
100 IF C THEN CALL SOUND(500,440,0)
110 GOTO 90
---------------------------------------------------------------------------
40 !COINCTEST(ALSO WORKS)
50 CALL CLEAR :: CALL SCREEN(3)
60 CALL COLOR(9,2,2,10,11,11)
70 CALL SPRITE(#1,96,2,89,1,0,10,#2,104,11,89,249,0,-10)
80 !ALL OBJECT
90 CALL COINC(#1,#2,10,C)
95 DISPLAY AT(24,1):"C= ";C
100 IF C THEN CALL SOUND(500,440,0)
110 GOTO 90
---------------------------------------------------------------------------
40 !COINCTEST(THISWORKS)
50 CALL CLEAR :: CALL SCREEN(3)
60 CALL COLOR(9,2,2,10,11,11)
70 CALL SPRITE(#1,96,2,89,1,0,10)! #2,104,11,89,249,0,-10)
80 CALL OBJECT©
90 CALL COINC(#1,#2,10,C)
95 DISPLAY AT(24,1):"C= ";C
100 IF C THEN CALL SOUND(500,440,0)
110 GOTO 90
120 SUB OBJECT©
130 CALL SPRITE(#2,104,11,89,249,0,-10)
140 !ALL COINC(#1,#2,10,C)
200 SUBEND
---------------------------------------------------------------------------
40 !COINCTEST(DOESNOTWORK)
50 CALL CLEAR :: CALL SCREEN(3)
60 CALL COLOR(9,2,2,10,11,11)
70 CALL SPRITE(#1,96,2,89,1,0,10)! #2,104,11,89,249,0,-10)
80 CALL OBJECT
90 !ALL COINC(#1,#2,10,C)
95 DISPLAY AT(24,1):"C= ";C
100 IF C THEN CALL SOUND(500,440,0)
110 GOTO 90
120 SUB OBJECT
130 CALL SPRITE(#2,104,11,89,249,0,-10)
140 CALL COINC(#1,#2,10,C)
200 SUBEND
---------------------------------------------------------------------------
40 !COINCTEST(DOESNOTWORK)
50 CALL CLEAR :: CALL SCREEN(3)
60 CALL COLOR(9,2,2,10,11,11)
70 CALL SPRITE(#1,96,2,89,1,0,10)! #2,104,11,89,249,0,-10)
80 CALL OBJECT©
90 !ALL COINC(#1,#2,10,C)
95 DISPLAY AT(24,1):"C= ";C
100 IF C THEN CALL SOUND(500,440,0)
110 GOTO 90
120 SUB OBJECT©
130 CALL SPRITE(#2,104,11,89,249,0,-10)
140 CALL COINC(#1,#2,10,C)
200 SUBEND
-
Nice. Thanks for that. It works.
-
Why does this not cause a coincidence?
40 !COINCTEST
50 CALL CLEAR :: CALL SCREEN(3)
60 CALL COLOR(9,2,2,10,11,11)
70 CALL SPRITE(#1,96,2,89,1,0,10,#2,104,11,89,249,0,-10)
80 !ALL OBJECT
90 CALL COINC(#1,#2,10,C)
95 DISPLAY AT(24,1):"C= ";C
100 IF C THEN CALL SOUND(500,440,0)
110 GOTO 110
-
Thanks for that last post. I changed the CALL LOCATE program a bit, but still can't get the JOYST control part. *BAD VALUE IN 120. DR,DC starting out at zero could be why, but then when I gave them values outside the loop, the black dot to be controlled by the joystick is stuck at that set of coordinates.
20 !TEST PROGRAM-USE CALL LOCATE WITH JOYST
25 P1=15 :: P2=10
30 CALL CLEAR :: CALL SCREEN(6) :: CALL COLOR(9,2,2)
40 A$="FFFFFFFFFFFFFFFF" :: B$="FFFFFFFFFFFFFFFF"
42 C$="FFFFFFFFFFFFFFFF" :: D$="FFFFFFFFFFFFFFFF" :: E$="FFFFFFFFFFFFFFFF"
50 CALL CHAR(96,A$,104,B$,112,C$,120,D$,128,E$)
60 CALL SPRITE(#1,96,2,89,121,1,1)
70 CALL JOYST(1,X,Y)
75 CALL COLOR(10,P1,6,11,P1,6,12,P1,6,13,P1,6)
80 !=R-Y/4 :: C=C+X/4
90 DR=DR-Y/4 :: DC=DC+X/4
100 !R=INT(R*8-7):: DC=INT(C*8-7)
110 !ALL POSITION(#1,DR,DC)
120 CALL LOCATE(#1,DR,DC)
130 CALL KEY(1,K,S)
140 DISPLAY AT(16,1):"SAME KEY=0 NEW KEY=1 NO KEY PRESS=-1"
145 DISPLAY AT(18,5):"KEY= ";K;"STATUS= ";S
150 DISPLAY AT(20,1):"X= ";X;"Y= ";Y
160 DISPLAY AT(21,1):"R= ";R;"C= ";C
170 DISPLAY AT(22,1):"DR= ";DR;"DC= ";DC
180 CALL HCHAR(1,16,104)!UP
190 CALL HCHAR(24,16,112)!DOWN
195 CALL HCHAR(12,3,120)!LEFT
198 CALL HCHAR(12,30,128)!RIGHT
200 IF Y=4 AND X=0 THEN CALL COLOR(10,P2,6)
210 IF Y=0 AND X=4 THEN CALL COLOR(13,P2,6)
220 IF Y=-4 AND X=0 THEN CALL COLOR(11,P2,6)
230 IF Y=0 AND X=-4 THEN CALL COLOR(12,P2,6)
250 GOTO 70
-
I've talked to the author of Timelost! on e-mail. He says there's another whole book, unpublished. He said it would be hard to publish it because the company owns the rights to it.
James
-
I snagged this piece of code from the XB game Devastator. On the cover of Compute!'s First Book
Of TI Games, the program is on page 186. Or page 197 of the .PDF version at http://pergrem.com/tibooks/
Is there a way to make this nice earth graphic in XB without using up 3 character sets?
460 CALL COLOR(2,6,1,3,6,1,4,3,6,5,15,2)
465 RESTORE 500
470 FOR I=6 TO 14 :: CALL COLOR(I,16,2) :: NEXT I
480 FOR I=0 TO 13 :: READ E$(I) :: CALL CHAR(40+I,E$(I)) :: NEXT I
490 FOR I=0 TO 7 :: READ E$(I) :: CALL CHAR(I+56,E$(I)) :: NEXT I
500 DATA 0000000000000F7F,000000000000F0FE,01030F1F3F7FFFFF
510 DATA 80C0F0F8FCFEFFFF,0001010103030303,FFFFFFFFFFFFFFFF
520 DATA 00808080C0C0C0C0,0303030301010100,C0C0C0C080808000
530 DATA FF7F3F3F1F0F0703,FFFEFCFCF8F0E0C0,7F0F000000000000
540 DATA FEF0000000000000,0800667C18666810
550 DATA E0F07F7F7FFFFFFF,0818F8F8F0F8F0F0,7F7F7F3D1C0E0201
560 DATA F0F0908800180000,03070F0F0F070703,F0FFFFFEFCFCF8F0
570 DATA 0303010101010101,E0C0C0C080808000
580 DISPLAY AT(2,24):CHR$(40)&CHR$(41) :: DISPLAY AT(3,23):CHR$(42)&CHR$(56)&CHR$(57)&CHR$(43)
590 DISPLAY AT(4,22):CHR$(44)&CHR$(45)&CHR$(58)&CHR$(59)&CHR$(45)&CHR$(46)
600 DISPLAY AT(5,22):CHR$(47)&CHR$(45)&CHR$(60)&CHR$(61)&CHR$(45)&CHR$(48)
610 DISPLAY AT(6,23):CHR$(49)&CHR$(62)&CHR$(63)&CHR$(50)
620 DISPLAY AT(7,24):CHR$(51)&CHR$(52)

CALL COINC
in TI-99/4A Development
Posted
After much confusion, I got the coincidences to register a sound both in the main and in the sub with meteor. Put the coinc check in the jump loop. 2 different coinc sounds to help make it easier to see which coincidence check is working, called from main or called from sub. plus you see it hit the meteor when jumping and make a sound, when testing.
635 DR=130 :: DC=1
640 CALL SPRITE(#1,96,16,DR,DC) :: CALL MAGNIFY(4)
650 CALL METEOR
660 ANIM=ABS(ANIM-4) :: CALL JOYST(1,X,Y) :: DR=DR-Y*0 :: DC=DC+X*4 :: CALL LOCATE(#1,(DR AND 255)+1,(DC AND 255)+1)
661 CALL COINC(ALL,HIT) :: IF HIT THEN 662 ELSE 663
662 CALL SOUND(300,-1,10) :: CALL DELSPRITE(#1)
663 CALL KEY(1,K,S) :: IF K=18 THEN CALL JUMP(DR,DC,FACE,HIT)
664 IF X<>0 THEN CALL PATTERN(#1,ANIM+X*2+108) :: FACE=SGN(X+4) :: GOTO 660
665 CALL PATTERN(#1,FACE*16+96) :: GOTO 660
670 IF DC<2 THEN DC=240 ELSE IF DC>240 THEN DC=2
810 SUB JUMP(DR,DC,FACE,HIT)
840 SDR=DR :: A=1
845 IF DC<2 THEN DC=240 ELSE IF DC>240 THEN DC=2
850 CALL KEY(1,K,S) :: IF K=18 THEN DR=DR-4 :: DC=DC+(A*PI/45)*5 :: IF DC>240 THEN DC=1
855 CALL COINC(ALL,CO) :: IF CO THEN CALL SOUND(150,-2,4)
860 !DISPLAY AT(23,1):A;" ";SIN(A*PI/45)
870 IF DR<8 THEN 890
880 CALL LOCATE(#1,DR,DC) :: IF S<0 THEN A=A+1 :: GOTO 850
890 IF DR<SDR THEN DR=DR+4 :: DC=DC+1 :: CALL LOCATE(#1,DR,DC) :: IF DC>240 THEN DC=1
900 IF DR<SDR THEN 890
910 SUBEND
920 SUB METEOR
925 CALL COLOR(6,16,2)
930 M$="00000000000F10204980A0829041221C0000000000C020A02020204080000000"
935 CALL CHAR(72,M$) :: DR=169 :: DC=1
940 CALL SPRITE(#2,72,16,DR,DC,20,-20)
960 !OR I=1 TO 100 :: NEXT I
970 SUBEND