Need advice with random scoring.
Nekku
Member Posts: 6
Hi. I'm making a game where the player runs a store, with the customers coming in and buying products. I made it so that the item the customer buys is random, selected from a table. But I can't seem to figure out how to make the game add the price of the item to the players money attribute. Is there a tutorial or an already answered question about this kind of thing? Tried to look but couldn't find one, I might have missed it. Thanks in advance for help.
Comments
@Nekku, does your table include a column with the price for each item?
Something like:
Now, you probably choose a random row number (e.g. self.RandomRow), to get the random product being bought.
This row number is now also used to add the corresponding price from column 2:
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Yes, there is a column for the item price. Thank you very much, @Hopscotch, that is exactly what I needed. Now I feel really silly for not figuring that out.
Glad I could nudge you into the right direction @Nekku
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com