The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.34 / 5.00 31,296 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.07 / 5.00 10,082 ViewsCurrently, attempting to code a menu that pops up when you hit an object (hit the finish next level menu pops up) this is the code i have, and i checked my instances.
onClipEvent (enterFrame) {
if (_root.player.hitTest) {
_root.result."Next Level" visible=1
}
}
What's wrong with my syntax?
hitTest takes either a single parameter containing an object, or an x coordinate, y coordinate, and true or false.
In this case I think this is what you want:
if (this.hitTest(_root.player)) {
Not to mention your missing a semi colon after your statement inside the if statement. Also, I don't think you reference an instance inside of quotations. Correct me if I'm wrong. And what is result? next level?
At 12/1/08 08:49 PM, WhiteWingDemon wrote: hitTest takes either a single parameter containing an object, or an x coordinate, y coordinate, and true or false.
In this case I think this is what you want:
if (this.hitTest(_root.player)) {
Not to mention your missing a semi colon after your statement inside the if statement. Also, I don't think you reference an instance inside of quotations. Correct me if I'm wrong. And what is result? next level?
Yeah, that was my intention. XD
Never tried hittest's before really. but yes my "result" was to make the box visible when the character touches the end.
One last question. I have my v-cam centered on the player. What would i have to add to this:
to make it center on the menu when the player hits the end?
At 12/1/08 10:08 PM, Unteries wrote: One last question. I have my v-cam centered on the player. What would i have to add to this:
onClipEvent (enterFrame) {
_y += (_root.player._y-_y)/4;
_x += (_root.player._x-_x)/4;
}
to make it center on the menu when the player hits the end?
Sorry, my ctrl+v stuck and it didn't paste, right as i hit enter.
Instead of having the camera center on the menu, have the menu center on the camera.
"Whoever said 'winners never quit' obviously never considered addicts." - Hoeloe