Random text

Started by gollymrme, Fri 02/09/2011 20:38:03

Previous topic - Next topic

gollymrme

Hello AGS friends! I need help with a game I'm working on...I want to create a quick game called Fortune Cookie where the player hits a hot spot to reveal a random text fortune. Maybe have 20 different fortunes set and have Ags pick one at random, then reset to be able to pick another one when you click the hot spot again. Any suggestions for a 'just starting out' game creator? Your friend and mine, Ryan

Mouth for war

you should check out the "random" function if I understand you right :)
mass genocide is the most exhausting activity one can engage in, next to soccer

Lt. Smash

I would suggest you to create a list, a so-called "one-dimensional array", with all the different fortunes:

Code: ags

String _fortune[20];
_fortune[0] = "Tonight you will find new love";
_fortune[1] = "Stay with your wife"; 
...


And then in the hotspots on_click you can randomly choose one string:
Code: ags

int ran = Random(19);
Display(_fortune[ran]);

SMF spam blocked by CleanTalk