Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Rolling problems.  (Read 785 times)

0 Members and 1 Guest are viewing this topic.
Rolling problems.
« on: July 06, 2007, 08:19:41 pm »
  • Hookshot to the Future!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 517
Code: [Select]
Information about object: objLinkRoll

Sprite: sprLinkRollD
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Create Event:
execute code:

image_speed=0.5

 Step Event:
execute code:

if global.facing="D"
{
sprite_index=sprLinkRollD
y+=1
vspeed=2
}

if global.facing="U"
{
sprite_index=sprLinkRollU
y-=1
vspeed=-2
}

if global.facing="R"
{
sprite_index=sprLinkRollR
x+=1
hspeed=2
}

if global.facing="L"
{
sprite_index=sprLinkRollL
x-=1
hspeed=-2
}
instance_create(x,y,objSmoke);

Other Event: Animation End:
execute code:

instance_destroy();
instance_create(x,y,objLink);

The problem is that link rolls ok but if ur not moving he rolls in place.
Logged
Check my ZRPG development blog at rev2k9blog.spaces.live.com
  • My Blog

Obsequious Eye

King of Glass
Re: Rolling problems.
« Reply #1 on: July 06, 2007, 08:35:30 pm »
  • Yes, I am mocking you
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 298
At the beginnig of your code for movement, have it set a variable, let's say, "moving" (how obvious), to 1, and when he's not moving (AKA, no direction keys are being pressed), have it set to 0. Then have it check if moving=1 at the beginning of the rolling code.
Logged
I'm watching you...
  • Omniscient Eye
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.131 seconds with 41 queries.