how do i do this?
i am doing a car game and it would be a bit weird if cars could go through each other
when they touch they need to 'bump into each other' and go away from eachother
Thanks anyone who can answer this.
Cao14
Offline
Cao14 wrote:
how do i do this?
i am doing a car game and it would be a bit weird if cars could go through each other
when they touch they need to 'bump into each other' and go away from eachother
Thanks anyone who can answer this.
Cao14
If the car game has a car you control, then try this:
<when green flag clicked>
<forever>
<if> << <key[ up arrow ]pressed?> <and> <( <{ Move up }> <=> 1 )> >>
<change y by( 10
<end>
<if> << <key[ down arrow ]pressed?> <and> <( <{ Move down }> <=> 1 )> >>
<change y by( -10
<end>
<if> << <key[ right arrow ]pressed?> <and> <( <{ Move right }> <=> 1 )> >>
<change x by( 10
<end>
<if> << <key[ left arrow ]pressed?> <and> <( <{ Move left }> <=> 1 )> >>
<change x by( -10
<end>
<end>
And then you could say forever if touching another car set move (whichever side its on) to 0.
Offline