GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How do I make my actor Player move like this?

idoistuffidoistuff Posts: 197Member
edited November -1 in Working with GS (Mac)
I want to try and make a game like this for my first game (don't worry I am not selling it on the appstore or anything, just for fun)

I want to know how to make my Player move like that? but instead of tapping just pressing the left and right keys on the keyboard.

Thanks!

Comments

  • VoidedSkyVoidedSky Posts: 1,095Member
    Hey. This is what should be in your actor:

    angle attribute: direction

    ---Move <self.direction>
    ---Speed <what ever your heart desires>

    ----Rule: When key <right> is down
    -----Change <self.direction> to <self.direction-90>

    ----Rule: When key <left> is down
    -----Change <self.direction> to <self.direction+90>

    This should be all. Hope this helps!
    ~CTM
  • idoistuffidoistuff Posts: 197Member
    what do you mean "angle attribute" I am new to this, I don't know really how to work gamesalad.
  • VoidedSkyVoidedSky Posts: 1,095Member
    When you create an attribute, select "Angle" from the attribute type list.
    ~CTM
  • idoistuffidoistuff Posts: 197Member
    okay so very dumb question here.. how do I create an attribute? I have

    ----Rule: When key <right> is down
    -----Change <self.direction> to <self.direction-90>

    ----Rule: When key <left> is down
    -----Change <self.direction> to <self.direction+90>

    all done.

    Thanks!
  • VoidedSkyVoidedSky Posts: 1,095Member
    When you are in an actors settings, on the left, there is an "Attributes" Panel. At the bottom of the attributes panel click the "+" and that will add a new actor. Do NOT type "self.direction" in the move behavior. Click the "e" and then click on arrow on the left. Then click on the name of your actor, and select the attribute you just created.
    ~CTM
  • idoistuffidoistuff Posts: 197Member
    EDIT: Wait I got it! Thanks!
  • idoistuffidoistuff Posts: 197Member
    How would I make it so my Player rotates to face the direction its going?
  • VoidedSkyVoidedSky Posts: 1,095Member
    http://gamesalad.com/wiki/
    Dig through this, it should help explain the basics.
    ~CTM
  • idoistuffidoistuff Posts: 197Member
    I have a few things I want to do but don't know how.

    -make the player rotate the direction it is heading.
    -when the player hits a wall to destroy player, wait 3 seconds then restart scene.

    also last but not least
    -whenever the scene starts I want a count down 3-2-1 GO! and when go appears the player will automatically start moving.
This discussion has been closed.