Resources > Coding

Returning objects, solids, and Game Maker.

(1/1)

Theforeshadower:
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.

Koh:
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: ---if !place_free(x + hspeed, y + vspeed)
{
  //Collision code here.
}

--- End code ---

Theforeshadower:
Ah.  Thank you.  I was reading the manual about solids and collisions the opposite way that a collision event overrides a solid. 

Navigation

[0] Message Index


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



Go to full version