PDA

View Full Version : [AS3] 'Escape' Styled Game Question...


popnfresh24
07-01-2009, 10:57 AM
Hey... i'm rather very new to AS3 or any scripting for that matter... but i followed one tutorial about making an escape game and i'm sure i can follow most of that and try some stuff to guess how to make the game i wanna make...

in the tutorial i took it only had the 1 screen and you only had to drag and drop stuff to find things behind it... but i want to make one that you can move around the room... that's the part i'm sure i can figure out...

what i don't know how to do is when you find an opbject and it goes in your inventory... how do you make it so when you click on it it then becomes the mouse and then you can interact with different objects

for example... you find a hammer... it goes in your inventory... when you click on it... your mouse becomes a hammer... you click on a mirror and it smashs... where as before if you clicked on it... it wouldn't have... and then say you hit spacebar or something and it turns back into your normal mouse...

i can make objects appear in an inventory... but the rest i'm lost...

pleeeaaase help :)

thanx - Jesse

bluemagica
07-01-2009, 11:05 AM
It's simple, just put all the stuff in a movieclip, in separate frames, and put the "arrow" in the first frame...you can label the frames appropriately too!
Then you can do, something like
Mouse.hide();
cursor_mc.start_drag(); //assumin cursor_mc is the new movieclip you made

afterwards, create a variable that denotes what your current picked object is.
var curr_obj = "normal";

when you click on hammer, simply set it to "hammer" instead of "normal", then you can do cursor_mc.gotoAndStop("hammer"), and voila, you get hammer as cursor!

For smashing and stuff, on the mirrors click event
if(curr_obj=="hammer")
{
//smash
}
else
{
//do nothing
}

popnfresh24
07-01-2009, 11:33 AM
thanx for the quick reply :)

i shall try what you said... though i still don't get the smash mirror thing (even though that was just an example from a game i saw... i won't be doing that lol)

but would the mirror and the smashed mirror be in the same movieclip??? just different frames with lables??? i think that's what i got from that... lol... is that right??? :)

bluemagica
07-01-2009, 12:35 PM
yeh that's the easiest way