Page 1 of 1

Collision-Problems on my Game "Carrier-Landing"

Posted: Sun Aug 08, 2021 8:56 am
by zx81jens
Hello User.

I am trying to program a Game, but my basic knowledge of BASIC is very limited - so I have some Problems with the Collision.

The Goal is to land the Plane (yes, I know, it is just a dot ;) ) on the grey Area


grey.JPG
grey.JPG (9.96 KiB) Viewed 2330 times


If you land on the black area, you´ll crash.

The Collision should be in Line 360 ...

Does anyboy can help me with this?? And of course: If anybody have any Ideas to make the Game better: do it... :lol:


CARRIERE.P
(2.94 KiB) Downloaded 128 times


Greetings and thanx
Jens

Re: Collision-Problems on my Game "Carrier-Landing"

Posted: Sun Aug 08, 2021 10:25 am
by dr beep
First
line 330 must be
330 LET P=P+1

rest follows later

Re: Collision-Problems on my Game "Carrier-Landing"

Posted: Sun Aug 08, 2021 10:46 am
by dr beep
362 LET F=P-X-X-1
363 IF F>0 THEN IF F<7 THEN GOTO WIN

You may solve the error that occurs when you land

Re: Collision-Problems on my Game "Carrier-Landing"

Posted: Sun Aug 08, 2021 5:42 pm
by XavSnap
Hi Jens,

There is a particularity with the PLOT command… it's like the PRINT AT command !
Using PRINT AT 10,10 set the DF_CC to the display memory offset.

PLOT set the DF_CC on the right display character, after the "dot" character.

Code: Select all

     10 FOR A=0 TO 18
     20 PRINT TAB 17;"½"
     30 NEXT A
    100 FOR B=0 TO 64
    110 PLOT B,10
    120 IF PEEK (PEEK 16399*256+PEEK 16398)<>0 THEN STOP 
    130 NEXT B
Test the next character after the ploted dot. space or grey char.
The bottom character will be tested on :
120 IF PEEK( (PEEK 16399*256+PEEK 16398)+32)<>0 THEN STOP
Left char:
120 IF PEEK( (PEEK 16399*256+PEEK 16398)-2)<>0 THEN STOP
Up char tested on :
120 IF PEEK( (PEEK 16399*256+PEEK 16398)-34)<>0 THEN STOP

Note: Don't use PRINT AT between the PLOT and the IF test...

Have fun !