The McLeodGaming forums were permanently closed on April 30th, 2020. You are currently viewing a read-only archive.
View unanswered posts | View active topics It is currently Fri May 15, 2020 5:36 am

Forum rules


IMPORTANT

This Forum is for Flash related questions ONLY! Do not ask questions about spriting, Game Maker, Photoshop, or anything else not related to Flash.



 [ 4 posts ] 
[Question] Hittest help 
Author Message
User avatar

Joined: Thu Nov 26, 2009 9:38 pm
Posts: 47
Location: rats! I forgot :/
Gender: Male
I have a hittest code. I can't seem to get it to work. I want the speedup movie clip to unload when the player movie clip collides with it.
The instances names are correct. I have no idea why nothing happens.
Also, what do i need to add to it to make it increases the speed number inside of the player movie clip?
Here is the code.
Code:
onClipEvent(enterFrame) {
if(_root.player.hitTest(_root.speedup)) {
   _root.speedup; {
      speedup.unloadMovie;
   }
}
}

Any help at all is appreciated!

_________________
ehh, sigs are getting old...


Sun Jul 11, 2010 4:38 pm
User avatar

Joined: Tue Aug 12, 2008 2:07 pm
Posts: 39
MK wrote:
I have a hittest code. I can't seem to get it to work. I want the speedup movie clip to unload when the player movie clip collides with it.
The instances names are correct. I have no idea why nothing happens.
Also, what do i need to add to it to make it increases the speed number inside of the player movie clip?
Here is the code.
Code:
onClipEvent(enterFrame) {
if(_root.player.hitTest(_root.speedup)) {
   _root.speedup; {
      speedup.unloadMovie;
   }
}
}

Any help at all is appreciated!


from what i can tell there was only one main problem
this being _root.speedup; {
if your remove this your problem should be fixed

try using this and tell me if it still doesn't work

Code:
onClipEvent(enterFrame) {
if(_root.player.hitTest(_root.speedup)) {
      speedup.unloadMovie;
   }
}

_________________
get free wii points here!


Mon Jul 12, 2010 5:15 pm
User avatar

Joined: Thu Nov 26, 2009 9:38 pm
Posts: 47
Location: rats! I forgot :/
Gender: Male
it still is not working. I can't find any errors... I have no clue how to make it work correctly.

_________________
ehh, sigs are getting old...


Mon Jul 12, 2010 5:43 pm
Site Moderator
User avatar

Joined: Fri May 22, 2009 3:44 pm
Posts: 4156
Location: saying things with posed looks
Gender: Anime Girl
Skype: Snail's Legacy
Currently Playing: umib and unib
Waifu: SNAIL
MK wrote:
I have a hittest code. I can't seem to get it to work. I want the speedup movie clip to unload when the player movie clip collides with it.
The instances names are correct. I have no idea why nothing happens.
Also, what do i need to add to it to make it increases the speed number inside of the player movie clip?
Here is the code.
Code:
onClipEvent(enterFrame) {
if(_root.player.hitTest(_root.speedup)) {
   _root.speedup; {
      speedup.unloadMovie;
   }
}
}

Any help at all is appreciated!





Do you want the player to speed up if it hittest's the speedup moviecilp? if so then you'd put in your players MC:


Code:
var speed :Number = 10;
var run :Number = 15;

onClipEvent(enterFrame) {
this._x += speed;
if(this.hitTest(_root.speedup)) {
    this._x += run;
      _root.speedup.unloadMovie;
   }
}


tell me if it doesn't work.

_________________
Image

Image Image Image

early 2k nostalgia mode


Wed Aug 04, 2010 9:49 pm
Display posts from previous:  Sort by  
 [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF.