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: [GM 7]Obj link swing  (Read 756 times)

0 Members and 1 Guest are viewing this topic.
[GM 7]Obj link swing
« on: March 07, 2007, 06:58:42 pm »
  • Hookshot to the Future!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 517
I know this is a simple problem but i cant remember how to fix it.
when i hit z(swing) it creates the object but does not delete it and recreate link.
Code: [Select]
Information about object: ObjLinkSwing

Sprite: sprLinkSwingD
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=sprLinkSwingD
global.facing="D"
}
if global.facing="U"
{
sprite_index=sprLinkSwingU
global.facing="U"
}
if global.facing="L"
{
sprite_index=sprLinkSwingL
global.facing="L"
}
if global.facing="R"
{
sprite_index=sprLinkSwingR
global.facing="R"
}

Other Event: Animation End:
execute code:

instance_destroy();
instance_create(x,y,objLink);
Logged
Check my ZRPG development blog at rev2k9blog.spaces.live.com
  • My Blog

Goodnight

Once and future Captain
Re: [GM 7]Obj link swing
« Reply #1 on: March 07, 2007, 10:42:38 pm »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
I can't see anything wrong with that, unless GM7 changed so you have to do instance_create() before instance_delete(), but I doubt that.

Maybe please post a version of your .gmk that only has this part so we can take a look, it could be something else causing it.

Just FYI, you can move all the code from Step to Create, because you only need to set the sprite once since Link can't turn while swinging. Also the global.facing="whatever" underneath each sprite code is useless & not needed.
Logged
Pages: [1]   Go Up

 


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



Page created in 0.1 seconds with 38 queries.

anything