Discord
Login
Community
DARK THEME

Collision with the map?

Hello, sorry for asking, but I really need help with my code for my undertale remake(microtale). I have basic movement and a titlescreen, but am unsure at how to make the player essentially collide with everything OFF the map. As in, if they are on the map, they are fine, but they cant step off of it. I know there is some weird math or something to make it work, but is that really the best way? I cant really put the code in here, as it wont allow me to put the whole thing in triple backtics, but I can add someone to the project if necessary!

Show the program code - it will be easier to help, make the program code public.

Usually the collision procedure looks like this:

  • you create a list of objects that are involved in the collision (e.g. enemies and the character controlled by the player, and elements of the environment).
  • you iterate through the list and check the collisions of all objects.
  • if there is a collision, you solve it based on e.g. the laws of physics (objects bounce off each other).

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community