ZFGC

Resources => Coding => Topic started by: Theforeshadower on July 20, 2014, 10:53:28 pm

Title: Returning objects, solids, and Game Maker.
Post by: Theforeshadower on July 20, 2014, 10:53:28 pm
I was adding a boomerang to LTTP Gameboy in Game Maker Studio when I hit a wall. The movement engine is a heavily modified versionof Goodnight's engine.  It makes use of solid objects.

Now, when you use the boomerange or have Zelda following you, the get stuck on any wall object.  I tried several ways to return the boomerang from move_toward to directly changing x and y values.  Either way I try, the boomerang  still gets stuck on any solid object between it and Link.

Just wondering what I can do.  I also tired setting the boomerang's collision mask to nothing which did not work either.
Title: Re: Returning objects, solids, and Game Maker.
Post by: Koh on July 20, 2014, 11:37:55 pm
Are you using a collision event?  If so, that is the problem itself.  When a collision event is called, the object is placed at the position it was at just before the collision.

Instead, to check for collision, you'd want to do a conditional check within the step event like
Code: [Select]
if !place_free(x + hspeed, y + vspeed)
{
  //Collision code here.
}
Title: Re: Returning objects, solids, and Game Maker.
Post by: Theforeshadower on July 21, 2014, 12:29:11 am
Ah.  Thank you.  I was reading the manual about solids and collisions the opposite way that a collision event overrides a solid. 

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