September 2010
Beginner
384 pages
8h 49m
English
One small adjustment stands between you and a fun keep-up game mechanic. We want the paddle to angle in the opposite direction to keep the ball bouncing inside the play area. Instead of multiplying by 2, we can multiply by -2 to flip the effect:
var tiltAroundX = Input.GetAxis("Mouse Y") * tiltAngle * -2;
Save and test. Hooray! The paddle tilts around the play area inclusively, keeping the ball more or less within our reach unless we get twitchy, and then we drop the ball. But that's the fun of keep-up moving the paddle just so to keep the ball in play.
Well, that was lots of fun! We've got a working keep-up game mechanic. Now let's go and do something else.
Oh, that? Don't worry about ...
Read now
Unlock full access