Game maker top down movement script


















Any plans to update this with that? Or do you know a quick copy and paste I could do? Like I said It's just going to take me a very long time. So this is something I've been meaning to write an article about, but think about it like this. I can't move. I can move. The result is still the same: there is something there, or there isn't. True or False.

This is the difference between "collision checking" and "collision handling". You simply want to change how your collision checking is done, which is the easier part to handle. You are welcome to ping me when you ask, but if I'm unavailable someone just as capable or more so should be able to help.

Here's an invite. I was wondering if it was possible to have it check for TWO wall object parents? I tried to modify the script myself to run multiple collision checks but I had a bad time. My game has some walls that block the player's movement and laser and some that only block movement. It's certainly possible to modify it to do that, but it may not be easy. If you want to discuss it further, Discord might be a better format for talking through your options.

If you aren't already a member, join the GM Discord server, then you can either ping me in an available help channel, or DM me. Bought the script I'm really new to this but needed to get some quick guidance. If I'm there and available, I'll be happy to assist you personally, if I'm not, there are tons of awesome people who can help you with getting this script up and running and just about anything else you need help with on your game dev journey!

I want to ask, is your "any speed" solution resisted to flickering? Lets say if I use 2. If they do, let me know There is the possibility of some jittering when sliding across a wall at a speed like 1. But your character should never "flicker", and if it does it is very unlikely to be my script that is the cause. This script is fantastic! Works perfectly for my project and after a little fine-tuning I have better movement than ever! If I separate the values, then speed increases exponentially regardless of direction I don't see motion add in here, but essentially what you want to do is keep track of your horizontal speed and vertical speed separately.

I had a question regarding whether or not this was intended behavior? It seems as if the player collision mask overlaps the wall objects? I wouldn't say it's "intended" behavior, but it is acceptable behavior. The player would never see the mask, so they wouldn't know anything is wrong. At most it would overlap by a pixel or two, and as long as it's not causing any shaking or jittering, it should be fine. This essentially happens because we are using a larger app surface than our view, meaning that the difference between the coordinate positions of 4.

So the player's y value is something like 4. Love the script but I have an issue now. I used to check "speed" for certain things not set but now none of that code works.

Is there another way to check the player speed so I can fix this? This is a tip for those who bought this awesome script. You can fake it with two ramps above and below each other like the angled path to the right in the demo. Beyond that, no. I'd like to know that before buy. It can also be converted to use tile collisions there's a blog about it posted here. I want to ask, if your assets are on some license? Or if i made game for sale, could i still use it with no extra payment?

You can use them in any project: personal or commercial. The only restriction is sort of the obvious one: don't buy the package and then turn around and re-sell it. That's a real dick move :D. I don't suppose you have a tutorial, do you?

I am trying to figure out what parts of the code I need for my keyboard controlled top-down game. My hope is to use the Basic code.

I understand some of what I need, but maybe not all of it, or where it should all go. Do I need the General Helpers or Vec2 scripts? What I have done doesn't seem to work. I apologize for my ignorance.

I'm trying to figure this out, and there are very little comments within the code. Any advice would be appreciated. Yeah, sorry, a tutorial is planned but on the back-burner a bit.

Ultimately the only thing you NEED is to call the script. You do the work to determine the direction you want the character to move in. You do the work to determine the speed you want the character to move.

Pass both of those to the script and it will take care of the rest. If you have further questions, feel free to hit me up on Discord. This asset is great! It makes collisions feel much less clunky, I'll probably continue to use it for quickly jumping into top-down games for ages. Tiles is great for just about everything, but I usually use objects for destructible obstacles. I recommend moving to tiles for destructible objects, honestly. It's very easy to add and remove tiles to and from your collision layer.

Thank you so much. Whenever I've tried to detect both objects and tiles before in one check it would go completely wrong. I was checking or instead of and, which usually resulted in players that can't move at all. Adding and removing tiles would work in most cases, but I like the destructible objects to have their sprites collision masks, and be able to be freely positioned. With tiles I would need need to stick to the grid and tile size , and every object that has a unique collision requires me to change my tile sprites, which I can see being tedious.

First, thanks for all you do for the GM community. Can you help me with something I don't quite understand with this method which looks awesome btw? That would make the collision mask identical to the shape of the sprite, right? If that's right, how did you get the collision mask in the example game above to not include the sprite's hair? Are there two objects the character and the green box that move together with only one the green box checking for precise collisions?

This is obviously important for our favorite genre of game 2. I don't see how this problem is solved just given the code above.

The player object has "collision mask" assigned to it. This is set in the object panel just below where you assign the sprite. The object will use the assigned sprite's mask for all collision checks. This way I know the mask is lined up and positioned to the character as I expect. Thanks and I'll post this clarification in the yoyo forums so you don't have to! Join thousands of other GameMaker users to discuss all things GameMaker and beyond. Get Started. My Account. GMS1 - Version 1.

Published August 23, Added a fix that created odd behavior when a move speed not equal to zero was passed to the script with a -1 direction. GMS2 - Version 2. Published May 26, Massive Overhaul -Updated Script allows better support for all angles and shapes of collisions -Updated example project showcases basic movement, momentum based movement, and analog controls.

Published January 1, Loading, please wait. Package contents Loading, please wait. Related Loading, please wait. Take a look at my updated article and see if that helps at all. You are commenting using your WordPress. You are commenting using your Google account.

You are commenting using your Twitter account. You are commenting using your Facebook account. Notify me of new comments via email. Notify me of new posts via email. Blog at WordPress. Share this:. Like this: Like Loading Is there a way to make it so that you can only use wasd instead of both wasd and the arrow keys?

The simplest way to make it work with this code would be to change this line of code: body. Very well explained for those of us that are just starting using Unity, thanks you very much! You are most welcome! Glad it helped! Thanks so much, I could not figure this out and youtube had no tutorials Like Like. No worries! I dont know how to delete my previous post!

I was a bit to early to post! It seemed that turning Gravity scale to 0 fixed the problem! Thanks for this page!! Hey I am working on a small game and I used the code! WASD should work by default as well as arrow keys.

Glad you worked it out. You just need to change the speed variable. And do the animations in Update, since they are not physics based Like Like.

How Do i do this Like Like. Thanks for the script bro Like Like. Didnt you forget about multiplying with Time. However, if you were creating your own physics system from scratch, yes you would have to factor in delta time manually, to make sure that the physics behaved the same on every PC Like Like. Love it! What error? Thanks Dude! It worked! Glad it helped you! I did this but if my gameobjects collides with another gameobject it moves to one position really werid pls help Like Like. Works like a charm.

Leave a Reply Cancel reply Enter your comment here Fill in your details below or click an icon to log in:. Email required Address never made public. Name required. Follow Following. Stuart's Pixel Games Join 52 other followers. Sign me up.



0コメント

  • 1000 / 1000