Old School

GingerBGamesGingerBGames Member Posts: 390
edited November -1 in Working with GS (Mac)
Hello GS'ers,

Not sure if I can explain this well or not, but i'll try. I want to have my hero walk left and right. When he encounters a bad guy, I don't want him to be able to run off the screen and leave everyone. How would I get it to where when my hero encounters a bad guy he can move on the current screen, but he cannot leave the current screen until all bad guys are gone? Like the old NES games, or SNES games.

Thank you.

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    Have a counter for bad guys.

    Scoll background if bad guys >0

    When a bad guy(s) appears on screen, change bad guys to bad guys +1

    When you defeat a bad guy, change bad guys to bad guys -1

    Hope that helps,

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • GingerBGamesGingerBGames Member Posts: 390
    Hello Quantumsheep,

    Thanks for the advise. However, in the particular game, I don't use a scrolling background, i'm laying the entire level out, so how would you do that if you don't mind?
  • quantumsheepquantumsheep Member Posts: 8,188
    When a bad guy appears, put two invisible walls on either side of the screen.

    Then have the player collide with them so he can't leave the screen.

    When all bad guys are dead (equals 0 in other words) move the walls off the screen.

    Cheers,

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

Sign In or Register to comment.