Problem with something that seems like it'd be simple

KamazarKamazar Member Posts: 287
edited November -1 in Working with GS (Mac)
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.

Comments

  • ktfrightktfright Member Posts: 964
    Do you have y-wrapping on?
  • KamazarKamazar Member Posts: 287
    I do, but the actor's destroyed before it reappears on the screen.
  • EastboundEastbound Member, BASIC Posts: 1,074
    Are you applying a max speed?
  • KamazarKamazar Member Posts: 287
    Yep, 75.
  • KamazarKamazar Member Posts: 287
    And on top of this, my "destroy self when colliding with a certain actor" rule isn't working either... strange.
  • ktfrightktfright Member Posts: 964
    if you don't have anteing scrolling, turn off y- wrapping, that might help.
  • KamazarKamazar Member Posts: 287
    I have a scrolling background that loops.
  • quantumsheepquantumsheep Member Posts: 8,188
    You can make your background like this:

    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

  • AfterBurnettAfterBurnett Member Posts: 3,474
    Helped me!
Sign In or Register to comment.