GameSalad

Howdy, Stranger!

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

Cant move any farther

skippertechskippertech Posts: 67Member
In my game, my actor gets stuck there (see image) http://imgur.com/VUru9
as if the wall.. is actually before the black part. not sure how i can get ridoff that. Also my actor has a jump function, but its jump up, so the sprite would always be facing the right. how could i make it face the left if the left button and jump is hit at the same time? and same for the right? thanks

Comments

  • gyroscopegyroscope I am here.Posts: 6,577Member, Sous Chef, PRO

    @skippertech

    Hi, the answer to your first question: your actor's size is larger than the opaque image of the figure, if you see what I mean.... the wall is colliding with the transparent part. So either make the size of the actor closer to your opaque image showing or adjust the collision by putting the collision behaviour in a transparent actor that's over the black wall but further to the right.... easier to do than explain....

    Your second question: make a boolean, let's call it FaceRight.

    In your Left button, add Change Attribute FaceRight to false and in your Right Button add to the rules there Change Attribute FaceRight to true.

    Now in your Jump button add to its Rules When FaceRight is false
    Animate with your left facing frames
    Otherwise
    Animate with your right facing frames

    Hope that gives you a start.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • skippertechskippertech Posts: 67Member
    gyroscope said:


    @skippertech

    Hi, the answer to your first question: your actor's size is larger than the opaque image of the figure, if you see what I mean.... the wall is colliding with the transparent part. So either make the size of the actor closer to your opaque image showing or adjust the collision by putting the collision behaviour in a transparent actor that's over the black wall but further to the right.... easier to do than explain....

    Your second question: make a boolean, let's call it FaceRight.

    In your Left button, add Change Attribute FaceRight to false and in your Right Button add to the rules there Change Attribute FaceRight to true.

    Now in your Jump button add to its Rules When FaceRight is false
    Animate with your left facing frames
    Otherwise
    Animate with your right facing frames

    Hope that gives you a start.



    Anyway I could get rid off the Transparent part of the Image?
  • gyroscopegyroscope I am here.Posts: 6,577Member, Sous Chef, PRO

    Just crop your animation frames in Photoshop or similar.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • MotherHooseMotherHoose Posts: 2,456Member
    oh dear … cropping each animateImage can really mess things up!
    … as they all usually need to be a largerSize to accommodate the legs extended views

    @gyroscope … your first advice for a sensorActor great! … +1 that!

    ==
    try using one gameAttribute for standStill/right/left/jump …index type
    name something like: direction

    this works well with flip … and less coding

    right/left/jumpButton … instances named 1 and 2 and 3 ( for jump)

    Rule: when my name is 1 changeAttribute: self.Image To: right/left/jump)

    Rule: when touch is pressed changeAttribute: game.direction To: self.Name
    Otherwise: change game.direction To: 0

    on playerActor:
    Rule: when game.direction = 0 … changeMLV X/Y To: 0
    Rule: when game.direction = 1 … changeFlip; changeMLV

    and the Rules for each of the conditions possible for direction

    Ex: Rule: when game.direction = 3 … changeAttribute: self.MLV Y
    (need to add to that jumpRule something to keep the MLV X running)

    whenever the actor's flip is true
       … images in its animateBehavior are also display as flipped … 

    image MH
This discussion has been closed.