I added apple trees to my RPG in Flash, I've got the art for apples and trees, and coding to make apples heal the player. What I'm trying to do is make the tree so that when your character is touching it and pressing spacebar, apples "fall" from the tree. Basically the tree frame 1 is a tree with 2 apples, and the second frame is a fruitless tree. How do I code something that will make 2 pick up-able apples appear near the tree, and slowly have the apples grow back (over around 15 minutes real-time)? P.S. I'm using an "apl" variable.
onClipEvent(load) {
apl=1
}
onClipEvent(enterFrame) {
if (_root.char_mc.hitTest(this)) {
if (Key.isDown(Key.SPACE)) {
this.apl -= 1
}
}
}
onClipEvent(enterFrame) {
if this.apl == 1 {
this.currentframe = ("1")
} else if {
this.apl == 0
this.currentframe = ("2")
}
}
Now this is typed from memory, so there will probably be some mistakes. It's just there to give you an idea of what I already have down for the tree.