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

Member Posts: 5

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?

• London, UK.Member Posts: 12,822
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.

• Member Posts: 450

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

• Member Posts: 5,689

This might help?

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

Darren.

• Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,926

@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

• Member Posts: 5

@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?

• Member Posts: 5

It always moves just a little bit too far.

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

...

• Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,926

@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

• Member Posts: 5
edited June 2014

@tatiang

Thanks! I got it to work now