random(?) obstacles
lobosco_estudio
Member Posts: 98
Best Answer
-
tatiang Posts: 11,949You can use a table or you can just spawn them. I'm not sure why you would use a table for this, unless you want full control (and non-random timing) over when obstacles appear. If you spawn obstacles, you just have a single spawner with a rule that picks a random number from 1 to 3 and then spawns the obstacle at a specific Y position based on the random value. If you wrap the Spawn behavior in an every 3 seconds timer, you'll have a randomly-appearing obstacle every 3 seconds. If you choose a random number for your timer as well, you can randomize that.
In a sidescroller game like that, generally the obstacles have simple move rules (e.g. Move 180 direction 200 speed).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
It would help to see your rules.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Now create a rule in obstacle and timer actor to detect if their Y position is the same to each other, then move one of them to the Y position of the other Road lane..
Well that's a rough idea on how to detect which actor spawned, basically you must create many "switch" attributes since GS can not directly reference to other actor X or Y position on the scene except through stored X or Y value in an attributes.
I hope it helps..
Cheers!
say that my obstacles appear at positions y 90, 180 and 270.
Much like the game Drive the Frog.
Realize that drive in the frog appear to be random groups of obstacles.
I created a few rows in the table with 6 columns
Example: 90, 180, 90, 270, 90 180.
the question is: Do I have to create multiple rows in the table and puts them at random? That is the only way to create obstacles?
Thank you guys!