I have started making a game and I have made it so that when someone interacts with a certain hotspot then they will obtain an item. However I want to make it so that the hotspot interacts differently when they click on it for a second time. Anyone know how ???
You have to create a variable that checks if the hotspot was clicked a second time.
It should look something like that:
int click=0;
interact_hotspotxy(){
if (click==0) { //first time hotspot is clicked
...
}
if (click==1) { //second and any further time hotspot is clicked
...
}
if (click==0) {
click++;
}
}
Or:
...
if (click==0) {
...
click=1;
}
else {
...
}
...
And since 3.0.1 I think, there's Game.DoOnceOnly (http://www.adventuregamestudio.co.uk/manual/Game.DoOnceOnly.htm).
(btw, this is probably the single most often posted question ever and the most common beginner's problem. Realizing that and doing a forum search first shouldn't be that far-fetched. This forum's first page contains at least one thread dealing with this problem.)
Quote from: matti on Fri 25/04/2008 13:25:32
You have to create a variable that checks if the hotspot was clicked a second time.
It should look something like that:
int click=0;
interact_hotspotxy(){
if (click==0) { //first time hotspot is clicked
...
}
if (click==1) { //second and any further time hotspot is clicked
...
}
if (click==0) {
click++;
}
}
Thanks my problem is solved now
Quote from: KhrisMUC on Fri 25/04/2008 13:54:14
Or:
...
if (click==0) {
...
click=1;
}
else {
...
}
...
And since 3.0.1 I think, there's Game.DoOnceOnly (http://www.adventuregamestudio.co.uk/manual/Game.DoOnceOnly.htm).
(btw, this is probably the single most often posted question ever and the most common beginner's problem. Realizing that and doing a forum search first shouldn't be that far-fetched. This forum's first page contains at least one thread dealing with this problem.)
Sorry didn't know there was a forum search. Thanks
There's also a Reply and a Modify button... :)