Copy link to clipboard
Copied
Hi I am busy building an escape the room type game where the user must find 6 items in a room before they can leave the room. I have almost build the room however I want to include a counter that displays how many items have been found. So when a item is found on the stage the counter would increase by one until a target is reached at which point the user would be able to exit the room. Any ideas how i would code this counter??
it looks like this:
itemNum++;
Copy link to clipboard
Copied
assign a variable to track the items and initialize it to zero when a room is entered (if that's what you want):
var itemNum:int = 0;
increment the counter when an item is found:
itemNum++;
Copy link to clipboard
Copied
I have created the variable and set to 0. However i'm not sure how to get it to add one when an item on the stage is clicked on?? What would this look like?? Any help would be great
Thanks in anticipation
Copy link to clipboard
Copied
it looks like this:
itemNum++;
Find more inspiration, events, and resources on the new Adobe Community
Explore Now