Placement Test

The next component developed was the placement. for this part I added 5 points where the objects can be placed. You can see the points represented by the green dots.

In Code these points will check for collision with the mouse, and if they collided then it would check to see if the part was already there, if it wasn't then it changes to the frame that has it and makes the game check for collision, it also gets rid of the object from the hand so that it seems like it placed it. Remember that there is not a separate object to remove from the hand, it simply changes to the frame that doesn't have any objects.

here is the code for that part:

if(this.placed == false && mainStage.cursor.objectName == this.name)
{
mainStage.cursor.gotoAndStop("hand");
this.gotoAndStop(1);
mainStage.CheckWin();
}

This is the swf file.


No comments:

Post a Comment