GameSalad

Howdy, Stranger!

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

I want it to look like the edge of my actor was knocked off

I am making a game that involves the player, basically just a square, getting pieces knocked off of it gradually making it smaller, but when I change the width, the square is shrunken from both sides so it doesn't look like a piece was knocked off. I want it to appear to have only shrunken from one side.
How can I achieve this?

Comments

  • SocksSocks London, UK.Posts: 12,822Member
    edited June 2014

    @SamStein said:

    I am making a game that involves the player, basically just a square, getting pieces knocked off of it gradually making it smaller, but when I change the width, the square is shrunken from both sides so it doesn't look like a piece was knocked off. I want it to appear to have only shrunken from one side.
    How can I achieve this?

    You just need to move it in the appropriate direction by the appropriate amount.

  • imjustmikeimjustmike Posts: 450Member

    You could fake this using images if you're not bothered about the hit box

  • UtopianGamesUtopianGames Posts: 5,685Member

    This might help?

    Cant post link due to forum rules but its free on DBA (search for ice slicer in our search bar).

    Darren.

  • tatiangtatiang Posts: 11,692Member, Sous Chef, PRO, Senior Sous-Chef

    @Socks said:
    You just need to move it in the appropriate direction by the appropriate amount.

    For example, if you decrease the width by 10 pixels then you need to move the actor to the left by 5 pixels (half of 10) at the same time. This is because the width is subtracted from each side (5 on the left, 5 on the right).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SamSteinSamStein Posts: 5Member

    @tatiang said:
    For example, if you decrease the width by 10 pixels then you need to move the actor to the left by 5 pixels (half of 10) at the same time. This is because the width is subtracted from each side (5 on the left, 5 on the right).

    This is the method I have been trying, but it never seems to work-out. Has anyone ever done a similar project and gotten this method to work?

  • SamSteinSamStein Posts: 5Member

    It always moves just a little bit too far.

  • SocksSocks London, UK.Posts: 12,822Member
    edited June 2014

    ...

  • tatiangtatiang Posts: 11,692Member, Sous Chef, PRO, Senior Sous-Chef

    @SamStein said:
    It always moves just a little bit too far.

    I can't imagine why that would be since it relies on precise math but here's a demo of the method I mentioned. Click the red square to reduce its size.

    http://www.fast-files.com/getfile.aspx?file=74452

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SamSteinSamStein Posts: 5Member
    edited June 2014

    @tatiang

    Thanks! I got it to work now

Sign In or Register to comment.