I am attempting to make a game similar to air hockey with both a two-player and a single-player version with a cpu. My two-player version works perfectly. However, even though the puck has the exact same code on the CPU version, it goes straight to a corner and "sticks" there. The puck is supposed to bounce off of a certain sprite (sprite 4) that makes up a border. Even though the code is the exact same thing for bouncing off of the border on the CPU version, it "sticks".
The border is "sprite 4"
The human player is "paddle right"
The computer player is "CPU"
This is the code on both the CPU and two-player versions for bouncing off of the paddles and the border. I know that I could just use "if on edge, bounce", but I would prefer to use this complex border.
The game is at http://scratch.mit.edu/projects/bmpatschool/2402236 For some reason, it does not work at all online, but does work when you download it (except for the previously discussed issues).
when gf clicked forever if <touching (Sprite 4)> turn 180 degrees end if <touching (CPU)> point in direction 90 turn pick random -45 to 45 degrees end if <touching (Paddle Right)> point in direction -90 turn pick random -45 to 45 degrees
Offline
Looks like you've already got a topic about this issue over here. Instead of making a new topic, please just add new posts to your existing one. Thanks!
Offline