![]() ![]() ![]() This adds a skill element to the game and makes it more fun. The reason why we don't have a bounce block for every occasion is because the sprite it's bouncing off isn't always straight. It is like a curve ball in baseball, bowling or soccer, or a slice/hook in golf, or spin in billiards or table tennis. This would be useful in a pinball-style game or any game where you need to have a sprite bounce off of a wall that's a certain color. ![]() They limit the bounce to return within a range of -80 to 80 degrees (this is for a horizontal paddle at the bottom of the screen…You would use different guards for a different paddle) Anyway, this allows the user to control where the ball bounces back by hitting the ball in different spots on the paddle. * I have direction guards to keep the skill shot from making the ball bounce at a bad angle. This is especially helpful with smaller paddles. 75) or a number greater than 2 if you want it to change more. The difference is then multiplied by 2 to make it greater…You could use a number less than 1 to make the change smaller (like. For example: when I receive point in direction ((180) - (direction)) if then turn cw (((x position) - ( of )) * (2)) degrees if then point in direction (-80 v) end if > then point in direction (80 v) end end OK…so explanation * The first line of code is a standard bounce off a horizontal surface * The next line of code modifies the bounce angle based on how far the ball is away from the center of the paddle. Games are more fun if you can learn skill to control them…I prefer creating a skill shot that allows you to control the rebound by choosing where the ball hits the paddle…. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |