Cycle through a list of numbers without repeating until the end.
TheAJTurner
Member, PRO Posts: 18
So for my project, I need a simple way to cycle through 1-30 without repeating a single number until all of the numbers have been used. Is there an easy way to do this?
Comments
You want to count up from 1 through 30 and then start over at 1 again?
There are many videos that explain how to do this. The general idea is to add the numbers to a table (one number per row) and then when a row has been chosen, use the value therein however you like and delete the row. Then repeat the process.
Google random without repeat gamesalad for tutorials.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Hmm I should do a video on this.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Already a few vids on this - many with slightly different techniques even.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
I may do a tutorial on this... lol
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
The original question seemed straight forward enough to me. But maybe the OP really did want to learn about random w/o replacement. Who knows?!?!
I didnt phrase the question well my bad guys. What I meant was I need to be able to RANDOMLY cycle through a numbers 1-30 without having any numbers repeat. I don't think I can use the remove cell function because I want to be able to repeat the process over again.
@TheAJTurner , you should have two tables, one with the numbers from 1-30, and the other with the numbers too, but you will remove the rows from this one once the random value is read from it. When it's all done, then you copy the original table back to have your numbers from 1-30 again.
I actually used this technique in Chibi Invaders to invoke a random alien to fire its laser, but the alien obviously had to be alive, hence the use of the table. There are 32 aliens, and if, say, alien#12 is destroyed, then 31 are left, but the game now "knows" alien #12 is destroyed, since it no longer forms part of the table during the current round.
My Blog / App Store / Google Play
Awh thank you mhedges this looks like it will work out great for me!
I don't generally watch tutorials, please forgive my ignorance
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@RThurman, I thought exactly the same thing.
@Lost_Oasis_Games, I'm sure you're too busy making tutorials to watch any!
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
I favour doing this with a text attribute rather than the overhead of tables. Same principles, though.
Edit: While you guys were arguing over who was going to make a video I snuck in and whipped mine out. Straight from silver-spoonville™!
Edit2: Totally miss-spelled Table-less. I'll fix it eventually :P
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Lol @Armelline!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS