-
items
i have looked on flash kit and found a tutorial on making an inventory system. that was a great help for me and making my game, however, i want to know how i use the items i pick up for a later use, for example i pick up a key and use it to unlock a door.
can some one help me out with either there own knowledge or by linking a tutorial?
--thanks
-
Now tell me whos watchin......
Which one is your question, how to go back to a recently picked up item, or using that item you picked up? Just go "if he pushes on the door AND he has the key, then open sesame" you can do that AND part one of two ways:
if(blah && blahblah){
}
or
if(blah){
if(blahblah){
}
}
-
i think you are stalking me haha, jk. i figured out the hit test problem i had btw.
umm it would be on how to use it
-
i think you are stalking me haha, jk. i figured out the hit test problem i had btw.
umm it would be on how to use it
and by your example:
if(blah && blahblah){
}
how would i do that for a a key actually opening a door?
if (key && door) {
waht goes here?
}
or is that totally wrong?
-
Now tell me whos watchin......
if (key && door) {
waht goes here?
}
well sorry i wasnt specific enough and i think i am stalking you. didnt even notice it was you lol.
k,
if(item == "key" && doorClicked == true){
// code goes here to make him go to next level.
// if your next level is next frame then do a gotoAndStop("level2");
}
this assumes that the item variable is the current item he has and the name of thet key item is key. so if he was holding an orange (how useful is that) than it would be item == "orange".
also you should add an else statement to it so you can say that YOU NEED THE KEY TO OPEN THE DOOR, JERK. like if he isnt holding a key and he tried to open the door, you would slap him in the head to tell him to find a key.
that would be like so:
if(item == "key" && doorClicked == true){
// code goes here to make him go to next level.
// if your next level is next frame then do a gotoAndStop("level2");
}else{
// somehow punish him for clicking on door without key
trace("He clicked on the door without a key");
}
hope this helps.
-
yeah it does, and dude i looked on your profile we are the exact same age, born on the exact same day.
-
Now tell me whos watchin......
lol that is crazy.. is your name sam?
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|