Hello everyone, I am new here, pleased to meet you!
So this is what I have:
- enemy ball movieclip, no instance name. Referred to as “this” in the code.
- one MovieClip with instance name player
- inside the MovieClip with instance name **player **is another MC with instance name shield on frame 2.
When I press SPACE frame 2 is played, i.e. the shield is showing.
The thing is that no collission is detected in the code below.
However, if I remove “.shield” from “_root.player.shield”, there is a collission but the **shield **is acting as a part of _root.player.
This results in widening my hitbox and loosing HP easier, not what a shield is for huh?
So, whats wrong with the code?
onClipEvent (enterFrame) {
if(this.hitTest(_root.player.shield))
{_root.score = 1000000000;}}