Putting different value but not randomly! (FB)
houssam.almas@hotmail.com
Member Posts: 21
Please I want to display different value but not randomly from a range not using random actions..
And I also want to know how to spawn different actors randomly using a spawner like flappy birds but instead of bricks there will cloud that one of three can be passable through but the two others no.
Please help I'm a 15 years old teenager working on really influential and educational game
Regards
And I also want to know how to spawn different actors randomly using a spawner like flappy birds but instead of bricks there will cloud that one of three can be passable through but the two others no.
Please help I'm a 15 years old teenager working on really influential and educational game
Regards
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Try explaining it again but writing much more (not just a sentence). What is the context of the game? What type of game is it, what happens in the game, etc.? How exactly are these range of characters used and what types of values would they contain? That will help me and others here be able to answer your questions better.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thank you for being helpful @tatiang
Once you understand tables, here's the idea...
Place each possible value in a separate row of the table, like this:
1
4
6
9
Then whenever you need a value, do Change Attribute game.choice (integer) to tableCellValue(tableName,random(1,tableRowCount(tableName)),1).
You can then display game.choice or use that attribute in a rule.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang is right though, the most efficient way to do it would be to use tables.
If you're not familiar with tables, another way of doing this would be something like:
If box is off the screen.
Change its value to something (1, 4, 6, or 9)
If player collides with box and value is 6, then kill player
The trick is to make each individual box have its own unique value. You'd need to work out a way of using a global variable, but making sure that not all the boxes change to that variable (unless that's what you need to happen)
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io