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: HElP: Collsion  (Read 1147 times)

0 Members and 1 Guest are viewing this topic.
HElP: Collsion
« on: December 24, 2006, 04:07:12 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 51
Hi
I'm making a Zelda game and I???m having some collision trouble. OK When OBJLink runs into the chest I have the little icon on the top saying OPEN. So when I run into the chest it says OPEN and when I walk away from the chest it still says OPEN on top because it was not deleted, how do I delete the OPEN. By the way I have a variable with OPEN "global.Open" When Link runs into the chest it sets it to "global.Open = 1" so how can I set the ???global.open = 0???, when  OBJLink is not colliding when the chest anymore.
I hope you guys can understand this.
lol
Thanks
~CJ~
 :)
Logged
~CJ






Goodnight

Once and future Captain
Re: HElP: Collsion
« Reply #1 on: December 24, 2006, 04:58:52 pm »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
You're using a Collision with OBJChest event, right?

Try putting this in the Step event:
Code: [Select]
if global.Open { global.Open=place_meeting(x,y,OBJChest) }
[edit]
Just realised a mistake, there shouldn't be the ! in there. Sorry!
« Last Edit: December 25, 2006, 07:07:14 pm by Goodnight »
Logged
Re: HElP: Collsion
« Reply #2 on: January 02, 2007, 11:21:53 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 51
Hi
Thanks for the code but, i'm don't know much about the meeting place code, could u explain it to me. I'v try to use it and i think im doin it wrong
Thanks alot
 :)
Logged
~CJ






Goodnight

Once and future Captain
Re: HElP: Collsion
« Reply #3 on: January 03, 2007, 05:24:31 pm »
  • With a Capital G
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 706
The help file doesn't explain it well?

place_meeting(x,y,obj) checks if this instance, when hypothetically placed at (x,y), is colliding with an instance of obj.

The x and y are there so that you can check if there would be a collision if this instance moved 1 pixel down, for example, by doing: place_meeting(x,y+1,obj)

The code I gave you continually checks if global.Open is true. If it is, and the player is colliding with a chest, it remains true, but becomes false when there's no collision.
Logged
Re: HElP: Collsion
« Reply #4 on: January 04, 2007, 03:21:52 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 51
Thanks
i did it out, works great
~CJ~
Logged
~CJ






Pages: [1]   Go Up

 


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



Page created in 0.452 seconds with 47 queries.