0 Favourites

Quirk with image point.

  • Hi, new to the forums, being testing the tool for the last couple of days and must admit that I'm loving it! <img src="smileys/smiley1.gif" border="0" align="middle" />

    I was writing a long post about some odd behaviors with a test I'm doing, but while I was writing and making sure I was getting my results right, found the solution for most of my problems. Odd hicups in firefox appears to be gone from my test with the updated version (12), and the other was a silly mistake in toggling my variables, need to be more carefull with these. <img src="smileys/smiley2.gif" border="0" align="middle" />

    One still puzzles me: being doing a port from a previous platform game that I worked on, as a test, and needs to attach a flame sprite to the character when I do a double jump (double jump is working nice, no problem). Created, as said in the tutorials, a player box with the platform behavior, then create a sprite with the images/animations of my character pinned to player box, and then set the flame sprite to the proper imagepoint of the image sprite (Every tick -> Set position to (Player.ImagePointX("Flame"), and Y as well)). When I do a double jump standing still, the sprite seems to appear in the right spot, just a little down, but when I do it running, the sprite appears moved off center; not by much, but sufficiently to not fit right where it should.

    Am I doing something wrong?

    The animations for "double jump still" and "double jump running" are exactly the same (I mean, it is a single animation at any situation), I set the imagepoints in the right place for the double jump animation, cropped both sprites... I did a test attaching the flame sprite to the player box and did not notice this offset, just when attaching it to the other sprite.

    Does anyone have some clue about what I'm doing wrong?

  • Wouldn't it be better if you put the imagepoint on the player box, instead of the sprite? This would avoid confusion and possible problems

  • Yeah, I think that it will be the way to go for now, but the problem is that it is harder to align the sprites, since the player box is empty. Probably will need to temporarily put some of the animation frames on it to align it right. Will need to change some of logic as well, since "set mirrored" is on the player sprite, not box, and the sprite misalign when mirrored; also not sure if it is advisable to flip the colision box at all.

    Just wonder if there is indeed some sort of "lagging" introduced by having multiple sprites attached to each other, or there is a right way to do that, maybe changing the logic, and I was doing it wrong.

    Thanks for the feedback anyway!

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • The best way to do animations, is to have a box that handles all collision and other events, and then the separate sprite, that you will position on top of the box. All alignment stuff should be handled in the sprite

  • So, just not to leave the question open, after some tests it seems that I need to do differently than what I initially thought. Instead of spawn -> set position to object imagepoint -> destroy once used, to my case I need to pin the sprite and control it pinned. I suppose it is the correct use, so.

    I've done a simple test with a red player box and two small blue boxes, the top pinned and the bottom with "set position to", the top behave as expected, always "attached" to the player box, but the lower one lags behind a little when you move, not what I wanted. Is it the way it should behave?

    The test: http://dl.dropbox.com/u/3688406/pintest.capx

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
217 18,531
humanescape's avatar
humanescape
Unread hot topic
66 25,879
hatsantos's avatar
hatsantos
Unread hot topic
57 16,720
Blinx123's avatar
Blinx123