spawn outside camera view in endless game


hello,

i´m not sure how to spawn actors under the camera view in an endless top to down scrolling game.
camera posion will be always at the same position, because the enemy actors are moving TO
my main actor, which is always at the same y posion and only change its x position.
are the position attributes in each actor for the hole scene or for the camera view?
I´ve about 5 different actors and the scene is about 3000*640 long.
One of the actor is affected by gravity and falling from above.
should i work with tables at this point? I havent worked with tables so far.

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    The actors X Y positions are for the scene not the camera.

    Darren.
  • JayJayDJayJayD Member Posts: 48
    Ok, than this wouldn´t work in an endless game
    but is there an attribute which is only for the camera view?
    or another possibility?
    how to use the tables when x and y are always changing?
  • JayJayDJayJayD Member Posts: 48
    anyone here who can help?

    Justin
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    i think you are overcomplicating things

    have your scene stay at 960x640
    spawn all your actors at like 1000 and have them move left towards your hero who you could have at position 480 or something (middle of screen)
    thats all you need to do

    why if your camera is never moving do you have a 3000 long scene?
  • JayJayDJayJayD Member Posts: 48
    yes i do ^^

    the camera dont move because the background and any other actor expect my main actor have a move behaviour for parallax scrolling. the actor only change its x (they are scrolling upward) position and camera won´t move.

    i think i got it... if the camera isn't moving i can always use the same spawn point for the actors right?
    i first thought that the coordinates are relative to the position of the background but they are for the whole scene when i'm right.
    i'll do this with tables, because they shouldn't spawn so random.

    Thanks, you helped me A LOT :)
Sign In or Register to comment.