Jump to content


Photo

"Sticky" Movement - Solved


  • Please log in to reply
15 replies to this topic

#1 Pixel8ed72

Pixel8ed72

    Musical Brony

  • GMC Member
  • 408 posts
  • Version:Unknown

Posted 29 July 2012 - 04:13 AM

Hello.

Yesterday, my movement worked fine.

Today, however, it's "sticky."
I press a key, he moves about 4 pixels, freezes, and a second later, starts moving.
I haven't changed any code, but the issue is occurring (It's happened numerous times. I have never solved it.)

My movement code is simply this:
if place_free(x-4,y)
x -= 4
else
if place_free(x-4,y-4)
{
x -= 4
y -= 4
move_contact(270)
}

Any ideas as to why this is happening?

Thanks.


EDIT:

Solved!
Thanks Biosyn!
3-4 +1's to you!
^_^

Edited by Pixel8ed72, 29 July 2012 - 11:01 PM.

  • 0

#2 Biosyn

Biosyn

    GMC Member

  • GMC Member
  • 207 posts
  • Version:Unknown

Posted 29 July 2012 - 05:08 AM

I made an object with nothing but a Step event and placed your code there. I did not see any sticky movement. It moves smoothly.

Try making an object with nothing but a Step event and place your code there. See if the sticky movement happens then. If it does, then there is something wrong with your GM installation maybe and you may have to reinstall. If it doesn't, then there is some interference with some other portion of the object's code.
  • 0

#3 Pixel8ed72

Pixel8ed72

    Musical Brony

  • GMC Member
  • 408 posts
  • Version:Unknown

Posted 29 July 2012 - 05:13 AM

Ok, I'll try it now.
:)

EDIT:
Nope, still sticky.
:(

I haven't changed any of the players code in anyway, nor have I made anything interact with the player(from another object)
I can post the .gmk, if it'd help.

Edited by Pixel8ed72, 29 July 2012 - 05:16 AM.

  • 0

#4 Takagi

Takagi

    GMC Member

  • Global Moderators
  • 4106 posts
  • Version:GM8

Posted 29 July 2012 - 05:42 AM

Is it that your game is running slowly? Is everything else in the game running fine?
  • 0

#5 Pixel8ed72

Pixel8ed72

    Musical Brony

  • GMC Member
  • 408 posts
  • Version:Unknown

Posted 29 July 2012 - 05:45 AM

No, everything runs as it should.
Movement is just not working as it did last night.

Here is the gmk, it'd be better then me explaining:
https://dl.dropbox.c...Time_Keeper.gmk
  • 0

#6 Biosyn

Biosyn

    GMC Member

  • GMC Member
  • 207 posts
  • Version:Unknown

Posted 29 July 2012 - 07:33 AM

Alright, I see what you mean. The sticky movement happens with me too. Interestingly enough, if you replace the x+/- movement with hspeed, the lag doesn't happen but instead brings a host of other problems. I'll try to find a solution but it might take a while
  • 0

#7 Pixel8ed72

Pixel8ed72

    Musical Brony

  • GMC Member
  • 408 posts
  • Version:Unknown

Posted 29 July 2012 - 07:35 AM

Yes, I just tried with hspeed, and it worked for level 1.
Into level 2, and guess what started happening again?
:/
As well as that, it causes the player to stick to walls, which instantly puts me off.
:P

If you could find a solution with-in 4 hours, that'd be great!
If it'd take longer, let me know, and I'll drop out of the Jam.

But a solution would be great, none-the-less.

Edited by Pixel8ed72, 29 July 2012 - 07:36 AM.

  • 0

#8 Biosyn

Biosyn

    GMC Member

  • GMC Member
  • 207 posts
  • Version:Unknown

Posted 29 July 2012 - 08:21 AM

4 hours? Unfortunately, I cannot say that I will have a solution by then. Sorry about that. Game looks nice and would have been a good challenger in the JAM. However, the problem should still be tackled...
  • 1

#9 Pixel8ed72

Pixel8ed72

    Musical Brony

  • GMC Member
  • 408 posts
  • Version:Unknown

Posted 29 July 2012 - 08:26 AM

:(

Well thanks anyway, Biosyn.

But, to clarify, did you mean you're unsure if you'll have it by then, or is that a definite no?

Edited by Pixel8ed72, 29 July 2012 - 08:33 AM.

  • 0

#10 Biosyn

Biosyn

    GMC Member

  • GMC Member
  • 207 posts
  • Version:Unknown

Posted 29 July 2012 - 09:16 AM

It is 5:00 in the morning here so I won't be able to find the solution in time. I'll get to it in the morning but like I've said, the problem should be tackled so at least you should be able to continue with the project.
  • 1

#11 Pixel8ed72

Pixel8ed72

    Musical Brony

  • GMC Member
  • 408 posts
  • Version:Unknown

Posted 29 July 2012 - 09:22 AM

Ok.
:)

If you it'd be possible to have it with-in 12 hours, I can still compete!

It's 7:22 PM here, and I don't need to submit the game until 9:30 AM tomorrow, and I wake up at 8:00 AM.

If it could be done by then, that would be amazing!
:D

You think it'd be found by then?

Edited by Pixel8ed72, 29 July 2012 - 09:22 AM.

  • 0

#12 Biosyn

Biosyn

    GMC Member

  • GMC Member
  • 207 posts
  • Version:Unknown

Posted 29 July 2012 - 09:25 AM

12 hours. Okay I might get a solution by then. But again, I cannot guarantee.
  • 1

#13 Pixel8ed72

Pixel8ed72

    Musical Brony

  • GMC Member
  • 408 posts
  • Version:Unknown

Posted 29 July 2012 - 09:27 AM

No worries. I appreciate you trying.

I've got a bit of a fail-safe prepared for if a solution isn't found.
:)

Plus, I'm working on finding the problem too.
:yes:

Edited by Pixel8ed72, 29 July 2012 - 09:27 AM.

  • 0

#14 Biosyn

Biosyn

    GMC Member

  • GMC Member
  • 207 posts
  • Version:Unknown

Posted 29 July 2012 - 05:58 PM

Good news. Found the problem.

It is in the Create Event when you create the object, objPlayerStats. Removing it fixes the problem. Currently working on fixing it but you should know that the problem lies with objPlayerStats and not with the player itself.

EDIT: Triangulated the problem in this objPlayerStats.

It is here:

if global.state = "speed"
state = 0;

if global.state = "slow"
state = 1;

However, I cannot see what these functions are doing nor where they are being run from. If there is time, can you tell me where these functions are being triggered?

Edited by Biosyn, 29 July 2012 - 06:26 PM.

  • 1

#15 Pixel8ed72

Pixel8ed72

    Musical Brony

  • GMC Member
  • 408 posts
  • Version:Unknown

Posted 29 July 2012 - 09:20 PM

Biosyn, you are literally a life-saver!

That was for an original function the player had; different abilities regarding time.
:P

But I removed the variable, and forgot to take that out.

Movement works!
Thank you so much, you actually saved my chances!
^_^
  • 0

#16 Biosyn

Biosyn

    GMC Member

  • GMC Member
  • 207 posts
  • Version:Unknown

Posted 29 July 2012 - 11:00 PM

Glad to hear that. And thanks for the +1. :thumbsup:
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users