Sell-Buy

Game Editor comments and discussion.

Sell-Buy

Postby Phil » Thu Apr 06, 2006 4:07 pm

Hi,how can I make the cahracter to buy?
You know he enters a Bulding and there is a list of objects,
and he can buy.
HELP!
Phil
 
Posts: 4
Joined: Tue Mar 21, 2006 3:38 pm
Location: Bulgaria
Score: 0 Give a positive score

Postby DilloDude » Fri Apr 07, 2006 12:01 am

Say you have a variable 'money'. You have a textNumber displaying the amount. You have an actor that says 'food: $50'. On mouse button down->left->food, write
Code: Select all
if (money>50)
{
    CreateActor("food", "food", no parent, no path, 0, 0, false);
    money-=50;
}

You can also use another event to trigger this, like keyDown or collision.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest