Option screen

allaboutiweballaboutiweb Member Posts: 42
edited November -1 in Working with GS (Mac)
Can anybody point me in the right direction for help on how to set up an option screen where a player can choose their actor. For example, if I wanted pick from a choice of cars to race, how would I make sure the right car appeared in the game?

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    What I would do is give each car a number.

    Do this by making an integer global attribute - let's call it 'carchoice'. Give it a value of '1' as a default.

    Then, on your menu screen, let's say you have three cars, Red, Blue and Black.

    On the red car, have the rule 'if touch is pressed, change attribute 'carchoice' to 1

    On the blue car, same rule, but change the number to 2.

    On the Black car, same rule again, but change the number to 3.

    Now, on your main car actor, have the rules:

    If charchoice is 1
    Change Graphic to Red car

    If carchoice is 2
    Change Graphic to Blue car

    If Carchoice is 3
    Change Graphic to Black Car

    You can put anything after the 'if Carchoice is' rule - for example, you may want to change the maximum speed of the car, or its friction or animation or whatever.

    As we set up '1' as the default value of Carchoice at the start, the game will assign that value to your player actor by default - in this case the red car.

    Hope that helps!

    QS :D

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

  • allaboutiweballaboutiweb Member Posts: 42
    QS,

    that is just what I was looking for, thanks very much. I particularly like the way you have written it so that a complete idiot like me can understand it too.

    Thanks a lot,

    Tim-AAi
Sign In or Register to comment.