Platformer

edited August 2016 in How To...

I am currently working on a platformer and the player can move and land on platforms but I can't make it so the character can walk into the side of the platform or bump it from underneath. The program has several classes and it's over 700 lines, so I won't post code unless you absolutely need it to solve my problem. And please tell me how you would make the platforms. Thanks

Tagged:

Answers

  • Answer ✓

    To make the character walk into the side of the platform, you could use the get() function to see what color is in front of the character. You can program the character's movement so that if the color in front of the character is the same color as a platform, it will detect a wall (basically, the program would find out if the character runs into a platform based on the color of the character's surroundings). To make it bump a platform from underneath, you can implement this strategy into the code the character uses to jump.

  • You can also make a 2d array that tiles the whole screen. Then you can mark each tile as solid or not solid. So the platforms are solid. If you run at them the character stops.

Sign In or Register to comment.