Randomly spawn actors that move down the screen in a lane

Hi, I am creating a game where the main actor can only move from side to side to dodge randomly spawned actors that move down the screen. I was wondering how to randomly spawn multiple actors constantly that move down the screen

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Hi there,

    What you could do is create a table and create x amount of rows (x being how many spawn points you want). Enter an X Position in each cell.

    Then, in a controller actor, in a 'every' timer, change a integer attribute (let's say it's called RandomAttribute) to random1,x (again, x being how many spawn points you want).

    You will then have a spawn actor behavior. In the X field, enter: tableCellValue(game.table, game.RandomAttribute, 1).

    In your spawned actor, you'll have a move behavior which will, as you might guess, move your actor in a specified direction.

    This is a vague explanation but hopefully it gets you on the right track. If you cannot wrap your head around it, or need a demo file, let me know.

  • myu699myu699 Member Posts: 96

    alright! can't try it right now(have homework) but as soon as I can I will try. I'll let you know if I need any more help. Thanks!

Sign In or Register to comment.