Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

9 years ago by AndrewMast

I need help with drawing my entities that the players' feet are under and yet the arms are over it.

Example:
/><br />
^ The player is drawn correctly because he is infront of the table.<br />
<img src=

9 years ago by AndrewMast

Please? Anybody? I really need this for my game!

-Andrew

9 years ago by Joncom

Possible to see the same screenshots but with show-debug-collision-boxes enabled? My thought is that if your player collision box is small (covering roughly only the size of his feet) then you shouldn't be having this issue...

9 years ago by AndrewMast

Here are the other images:

/><br />
<img src=

9 years ago by Joncom

Sounds like you want the player to be drawn under the table, BUT you want his upper half to be drawn above the table.

So maybe always draw the player under the table.

But then in your game update function, draw the player a second time, but only draw the upper half.

update: function() {
   this.parent();
   /* now draw the upper half of the player again */
}

So this would mean finding the ig.Image instance in player.currentAnim, and then drawing whatever specific chunk is relevant.

http://impactjs.com/documentation/class-reference/image#draw

9 years ago by AndrewMast

Thanks! I will try something like that. I have other entities that I don't want the upper half to be on top of, so I will need to change something.

I have a lot of layers for the player. What's the best way to only get the top half of the player?

-Andrew

9 years ago by AndrewMast

What would the best way to draw my entity to an external canvas and then draw it back in the game?

-Andrew
Page 1 of 1
« first « previous next › last »