GameSalad

Howdy, Stranger!

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

Jumping hero animates when in contact with another actor (Fixed)

ohtukrwohtukrw Sir dogePosts: 106Member
edited July 2016 in Help Wanted

Every time I take one step forward it seems that I actually go 2 steps back... :blush:

After creating the images, I failed to animate this jumper meme.

1) Can't see the actual animation.

2) Can't make pogo to appear that it touches the ground, because of fixed collision shape.

If you are a good guy Greg, please post your suggestions or a fixed zip. :wink:

File url:

url removed

Comments

  • SocksSocks London, UK.Posts: 12,822Member
    edited July 2016

    @ohtukrw said:
    Every time I take one step forward it seems that I actually go 2 steps back... :blush:

    After creating the images, I failed to animate this jumper meme.

    1) Can't see the actual animation.

    Your hero actor animation is set up to play when the hero actor is in contact with the ground actor, this contact happens only very fleetingly, for a fraction of a second, so if the animation were to play it would only play for a very brief fraction of a second, not even long enough for 1 frame of the animation seeing as your frame rate is set to 5fps.

    5fps is 12 code cycles per frame, so in theory the actor would need to be in contact with the ground actor for 12 code cycles for the animation to play even 1 frame, the actual time in contact is unlikely to be longer than 1 code cycle.

    Even if this were to work the animation is not looped so it would only ever play one cycle of the animation.

    @ohtukrw said:
    2) Can't make pogo to appear that it touches the ground, because of fixed collision shape.

    The collision of an actor is based on its collision shape, your animated image is 75 pixels above the bottom of the image area, so it will appear to bounce 75 pixels above the ground actor.

  • ohtukrwohtukrw Sir doge Posts: 106Member

    @Socks said:

    @ohtukrw said:
    Every time I take one step forward it seems that I actually go 2 steps back... :blush:

    After creating the images, I failed to animate this jumper meme.

    1) Can't see the actual animation.

    Your hero actor animation is set up to play when the hero actor is in contact with the ground actor, this contact happens only very fleetingly, for a fraction of a second, so if the animation were to play it would only play for a very brief fraction of a second, not even long enough for 1 frame of the animation seeing as your frame rate is set to 5fps.

    5fps is 12 code cycles per frame, so in theory the actor would need to be in contact with the ground actor for 12 code cycles for the animation to play even 1 frame, the actual time in contact is unlikely to be longer than 1 code cycle.

    Even if this were to work the animation is not looped so it would only ever play one cycle of the animation.

    @ohtukrw said:
    2) Can't make pogo to appear that it touches the ground, because of fixed collision shape.

    The collision of an actor is based on its collision shape, your animated image is 75 pixels above the bottom of the image area, so it will appear to bounce 75 pixels above the ground actor.

    Thank you for an explanation, but it would be more helpful to get some suggestions, is it possible to make it animate somehow?

  • SocksSocks London, UK.Posts: 12,822Member

    @ohtukrw said:
    Thank you for an explanation, but it would be more helpful to get some suggestions, is it possible to make it animate somehow?

    Make an attribute, change it to true when the actor collides with the floor, then use a rule that plays the animation when this attribute is true.

    Use the last frame of your animation as a trigger to change this attribute back to false.

    As for the animation not touching the floor, open the frames into an image editing application and trim 75 pixels off the bottom of each image.

  • ohtukrwohtukrw Sir doge Posts: 106Member

    @Socks said:

    @ohtukrw said:
    Thank you for an explanation, but it would be more helpful to get some suggestions, is it possible to make it animate somehow?

    Make an attribute, change it to true when the actor collides with the floor, then use a rule that plays the animation when this attribute is true.

    Use the last frame of your animation as a trigger to change this attribute back to false.

    So rule> attribute > actor > then I cant find the collision. I am a total noob, sorry. Also do I need to type in ''true'' or some kind of number? :blush:

  • SocksSocks London, UK.Posts: 12,822Member
  • ohtukrwohtukrw Sir doge Posts: 106Member

    @Socks said:

    I make self.A and self.B as boolean in actor attributes (windows pc), however when I stumble upon your last rule:
    attribute>self.B = 5 it doesn't allow me to select the equal sign, only : is true or false option. :(

  • SocksSocks London, UK.Posts: 12,822Member

    @ohtukrw said:
    I make self.A and self.B as boolean in actor attributes (windows pc), however when I stumble upon your last rule:
    attribute>self.B = 5 it doesn't allow me to select the equal sign, only : is true or false option. :(

    Boolean (An on and off type attribute, good for switches and true/false type rules)
    Integer (Whole numbers)
    Real (Numbers with decimal places)

  • ohtukrwohtukrw Sir doge Posts: 106Member

    @Socks said:

    @ohtukrw said:
    I make self.A and self.B as boolean in actor attributes (windows pc), however when I stumble upon your last rule:
    attribute>self.B = 5 it doesn't allow me to select the equal sign, only : is true or false option. :(

    Boolean (An on and off type attribute, good for switches and true/false type rules)
    Integer (Whole numbers)
    Real (Numbers with decimal places)

    self.A = boolean
    self.B = integer

    Made it animate. Thank you. My brain needs additional cooling now.

  • SocksSocks London, UK.Posts: 12,822Member

    @ohtukrw said:

    self.A = boolean
    self.B = integer

    Made it animate. Thank you. My brain needs additional cooling now.

    Good ! :smile:

    Yes, attribute B would need to be an integer or a 'real' or 'index' attribute or basically anything that can hold a number . . . a boolean attribute can only be true or false.

  • PhilipCCPhilipCC Encounter Bay, South AustraliaPosts: 1,390Member

    @Socks. o:) You have the patience of a saint in this Forum... and that I really admire.

Sign In or Register to comment.