Problem with something that seems like it'd be simple
Kamazar
Member Posts: 287
Alright, so I've been away from GS for a while, so that may be the problem, but it weird that I should get something so simple wrong.
Anyways, all I'm doing is having a actor that accelerates downward (so I can neglect using the gravity function) be spawned every 2 seconds. Thing is, after about ten spawns or so, it'll start spawning every second, and speeds up until the actors start overlapping. The actors are moving at a set speed and are destroyed after exiting the screen. I just don't get it.
Anyways, all I'm doing is having a actor that accelerates downward (so I can neglect using the gravity function) be spawned every 2 seconds. Thing is, after about ten spawns or so, it'll start spawning every second, and speeds up until the actors start overlapping. The actors are moving at a set speed and are destroyed after exiting the screen. I just don't get it.
Comments
Say it's a starfield. Actor size doesn't matter - when you place it in your scene, just stretch it so it fills the screen.
This actor will contain the following
A movement behaviour (say direction 180, speed 90 if you're doing a side scroller).
Then underneath this a single rule:
When
Attribute self.position.X < - self.Size.Width /2
Change attribute self.position.X to self.Position.X + self.Size.Width + game.Display Size.Width
Then, put the actor in your scene as described above, and add a second instance of the actor next to it of equal size.
This will allow smooth scrolling, and will mean you can get rid of the wrap.
Hope that helps
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io