Page 1 of 1

Scripting: "Get 100 gold, get 1 life"

PostPosted: Sat Jun 09, 2007 7:07 am
by Bee-Ant
Hi friends...
1. How to make script: "If player get 100 of gold, then player get 1 life"
And in what menu (collision, draw actor, create actor, or other) and actor (player or gold) I'll put it??? :lol:
2. How to make script: "If player get 3 of keys, then the door are open"
And in what menu (collision, draw actor, create actor, or other) and actor (key or door) I'll put it??? :lol:
3. I'll call you "Boss" if you can help me :cry:
thaks a lot... :D

Re: Scripting: "Get 100 gold, get 1 life"

PostPosted: Sun Jun 10, 2007 3:39 pm
by Sgt. Sparky
Bee-Ant wrote:Hi friends...
1. How to make script: "If player get 100 of gold, then player get 1 life"
And in what menu (collision, draw actor, create actor, or other) and actor (player or gold) I'll put it??? :lol:
2. How to make script: "If player get 3 of keys, then the door are open"
And in what menu (collision, draw actor, create actor, or other) and actor (key or door) I'll put it??? :lol:
3. I'll call you "Boss" if you can help me :cry:
thaks a lot... :D

1. make a variable called gold, make it an integer.
on the destroy Actor event of the coin,
Code: Select all
gold++;

now make another integer called lives.
on the draw actor event of some text actor,
Code: Select all
textNumber = gold;
if(gold >= 100)
{
    lives++;
    gold = 0;
}


and you can modify that code using other variables to make everything else. :D

Thanks Boss

PostPosted: Mon Jun 11, 2007 5:06 am
by Bee-Ant
Yhanks sparky...you're my boss now...

Re: Thanks Boss

PostPosted: Mon Jun 11, 2007 11:57 am
by Sgt. Sparky
Bee-Ant wrote:Yhanks sparky...you're my boss now...

how many times must you say that. :lol: