Re: TIB: (no subject)


[Prev][Next][Index][Thread]

Re: TIB: (no subject)




In a message dated 11/8/1998 5:52:03 PM Mountain Standard Time,
BlAsTo1414@aol.com writes:

<< I got it to work using the following code.
 
 > Lbl C
 > getky->C
 > If c=24
 > Then
 > A-3->A               ;-3 so it moves faster
 > Else
 > If C=26
 > Then
 > A+3->A               ;same thing
 > End                     ;before I had forgoten
 > End                     ;the Ends
 > Text(A,B,"  I#I  "
 > Goto C
 
 ok, one last thing.  after I get the sprite/character on the screen, how can
I
 make things come from the top of the screen and detect collision with the
 sprite/character?  I want to do either a racer or a modified Space invaders
 type game.
 
 Thanks for the help
 
 BlAsTo1414
  >>

To move something down the screen, you would do:

 1->E:E->F			;this is the coordinates of the thing.
 > Lbl C
 > getky->C
 > If c=24
 > Then
 > A-3->A               ;-3 so it moves faster
 > Else
 > If C=26
 > Then
 > A+3->A               ;same thing
 > End                     ;before I had forgoten
 > End                     ;the Ends
 > Text(A,B,"  I#I  "
 
Text(E,F, "@"		;this is the thing you want to move
E+3->E				;this will increase the placing of the thing

  > Goto C

Using this, the thing would move down everytime it came to that command.  To
check to see if it hit the |#|, you would just add an if/then/end statement
before the Goto C.  For example:

E+3->E
If E==A and F==B		;this checks if the coordinates of the |#| are the same as
the thing Then					;moving down
[other commands here]
Stop
End
Goto C

Dan