Author Topic: [Solved]Bring hero back?  (Read 223 times)

Zefk

  • Sr. Member
  • ****
  • Posts: 482
  • Just helping Solarus
    • View Profile
    • Zelzec Business
[Solved]Bring hero back?
« on: May 01, 2017, 04:38:40 am »
I am wondering if there is a way to being the hero behind other entities without changing the layer. The reason is for my push and pull animation.

I tried hero:bring_to_back(), but the documentation does mention that the hero is not affected by this.

Animation looks funny:
Changing the length of her arms and legs would make her look like she is doing some sort of monkey dance. The only way this could work is if I make the excuse that she has telekinesis psychic powers.


Hero needs to be sent to back:




What I want it to look like, but it has a bug: (In this case...I chopped the heroines legs off.)



I would need to cancel the push/pull animation for everything, but the block. What would be the best way to disable push and pull for everything, but the block entity?
« Last Edit: May 02, 2017, 05:24:09 am by Zefk »

Liu_Kong

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Bring hero back?
« Reply #1 on: May 01, 2017, 12:39:43 pm »
I am wondering if there is a way to being the hero behind other entities without changing the layer. The reason is for my push and pull animation.

I tried hero:bring_to_back(), but the documentation does mention that the hero is not affected by this.

Animation looks funny:
Changing the length of her arms and legs would make her look like she is doing some sort of monkey dance. The only way this could work is if I make the excuse that she has telekinesis psychic powers.


Hero needs to be sent to back:




What I want it to look like, but it has a bug: (In this case...I chopped the heroines legs off.)



I would need to cancel the push/pull animation for everything, but the block. What would be the best way to disable push and pull for everything, but the block entity?

Hmm... maybe for entities/heroes/etc. drawing order should be determined by tile position? So that entities in tiles with lower Y get drawn first, giving the effect that you wish.

Zefk

  • Sr. Member
  • ****
  • Posts: 482
  • Just helping Solarus
    • View Profile
    • Zelzec Business
Re: Bring hero back?
« Reply #2 on: May 01, 2017, 06:27:29 pm »
Quote
Hmm... maybe for entities/heroes/etc. drawing order should be determined by tile position? So that entities in tiles with lower Y get drawn first, giving the effect that you wish.

Maybe the hero should have a Z order function. Kinda like how the custom entity has a y order function or maybe the hero should only be able to push and pull on blocks.

1. One way at the moment to solve this problem is by making a funny looking push/pull animation. That would be done by pushing her legs up and extending the arms.

2. The second way would be by having another block entity follow the block entity on a different layer. I do not know the kind of weird effects this will have.
« Last Edit: May 01, 2017, 06:36:44 pm by Zefk »

Diarandor

  • Hero Member
  • *****
  • Posts: 701
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Bring hero back?
« Reply #3 on: May 01, 2017, 11:34:49 pm »
IMO, the best solution is to adapt the art to these engine limitations (related to bounding boxes and traversable properties), and hence these limitations have to be taken into account during the creation of the art. Some of these limitations may just be the way Solarus works (or maybe not, only Chris knows this), so maybe sometimes there is no other solution than re-drawing.

llamazing

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Bring hero back?
« Reply #4 on: May 02, 2017, 12:02:58 am »
Could you cut off the tops of the bookshelves and draw the tops on a higher layer? That way the hero would naturally be behind them without having to change the layer of the hero.

Zefk

  • Sr. Member
  • ****
  • Posts: 482
  • Just helping Solarus
    • View Profile
    • Zelzec Business
Re: Bring hero back?
« Reply #5 on: May 02, 2017, 12:33:34 am »
Quote
IMO, the best solution is to adapt the art to these engine limitations (related to bounding boxes and traversable properties), and hence these limitations have to be taken into account during the creation of the art. Some of these limitations may just be the way Solarus works (or maybe not, only Chris knows this), so maybe sometimes there is no other solution than re-drawing.

The animation just looks funny when trying to adapt the art to this limitation. I setup a few animations before posting, but it would just look better if I was able to bring the hero behind the block entity.

Quote
Could you cut off the tops of the bookshelves and draw the tops on a higher layer? That way the hero would naturally be behind them without having to change the layer of the hero.

That is a good idea, but I will just go with one of the funny animations I created...


Diarandor

  • Hero Member
  • *****
  • Posts: 701
  • Cats are cool! (ΦωΦ)
    • View Profile
Re: Bring hero back?
« Reply #6 on: May 02, 2017, 01:35:25 am »
I agree with llamazing. Actually I was refering to the blocks case: in this case, just modify the origin point of the hero sprites. I guess that there is no need to modify the art to solve this issues.

Zefk

  • Sr. Member
  • ****
  • Posts: 482
  • Just helping Solarus
    • View Profile
    • Zelzec Business
[Solved]Bring hero back?
« Reply #7 on: May 02, 2017, 05:23:30 am »
I just released v2 of my sprite. In case anyone wants to see the new push and pull animation.



I guess this post is not an issue anymore, but it would nice to be able to "bring the hero back" in the future.
« Last Edit: May 02, 2017, 05:26:13 am by Zefk »