Due to failure of my previous blog entry, I've been afraid of posting for a while.. So I went to the Rules page, and read what was there… and decided to post another entry here, asking people's help. Nobody helped me back at the GMC. Call me a donkey if it's not allowed here again, please.
I am asking help regarding GM, actually. As I am now making a platformer allowing the player to walk on the walls and the ceiling, I found out that it was not as easy as it seemed. As I progressed (Not too fast), I had to stop at one problem.. One which I don't know how to fix. I don't know how to do the keyboard movement. Yeah, it's a shame, I tried doing anything that didn't exceed my knowledge.. without success. Here is some of the code I used:Create Event//INIT VARIABLES
gravspd=6;
grav=0.5;
grav_dir=-90;
walkdir=grav_dir+90;
gravity_direction=grav_dir;
if (place_free(x,y+speed))
{
gravity=grav;
}
else
{
gravity=0;
}
if (speed>gravspd)
{
speed=gravspd;
}
if (grav_dir=360) {grav_dir=0;}
if (walkdir>=360) {walkdir-=360;}
if (keyboard_check(vk_right))
{
//The place where I'm stuck.
}
Keep at it, I find doing stuff myslef much more phun.
True, but I'm really stuck.
I don't know why this would be against the rules here.
I also don't know why so many people are afraid of the built-in functions gravity and gravity_direction. They work just fine, but in most cases, it <i>is</i> better to make your own movement variables.You have to be more specific on what you're trying to accomplish. If you want a special movement code, you'll have to make up those variables, too. Once you stray from built-in functions, you're going to have to do <i>everything</i> your way.Yes, I do use inbuilt functions, but only for minor thangs
Basically my problem is that I can't use speed for the walking, as it's already in use for gravity. I would need a function that makes it go to a direction with a certain speed..
However I think I have just found a part of the solution to my problem… Using motion_set();EDITNope, guess it didn't work out as I wanted it to… Help, anyone?Motion_set wasn't bound to work. Like I said, DIFFERENT variables. EG: xsp, ysp.
Interesting.. explain.
Make another platform engine where the gravity's direction is 0, and where you jump towards the left end of the screen. Then combine them. I mean when you're character is meant to walk on the wall change the engine, and for example after 5 secs set it back to the primary engine, so that you're character falls off the wall. Well, I know that sounds a little weird, but it should work fine in a well organized piece of code.
It's.. Not exactly what I'm trying to achieve, but your suggestion might get me somewhere.