![]() ![]() "There is something there? I can't move." "There isn't? I can move." When we say "place_meeting()" we are basically asking "is there a collision here or not." And then we handle the result of that. So this is something I've been meaning to write an article about, but think about it like this. Want to use tiles instead of objects? Check out my devblog about converting the system to tiles! What if you want to knock your player back from taking damage? Now you have to write new collision code to handle moving without pressing any buttons!Ĭall that in your step event with your own direction, speed, and wall object parent, and your player will move and collide flawlessly! When you bind your world collision to your controls, you are very limited in what you can do. The system is completely independent of controls! If you are new to game maker or have done any research into basic collision detection, maybe this code looks familiar to you? With a single script, you can move your character around your room with perfect world collision! All you need to do is provide a direction to move and a speed to move at and you are done! ![]() Do you want to use ANY movement speed From 1, to 2.45, to 18, and even higher? Do you want to use the same collision code for all characters (players, enemies, npcs, bosses)? It's pretty cool.Īre you working on a top down game? Something like Binding of Isaac, Zelda, or Secret of Mana? Do you want your character to slide along ramps and walls smoothly. Advanced example with momentum & friction.Basic simple character motion example code.Example room with rotated, scaled rectangle collisions and custom shape collision blocks.Movement and Collision 100% independent of controls!.Slide along ramps of any angle and any size!. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |