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

1 decade ago by congwang0517

if i want to resize a entity's size by it's 80%,what i should do?

1 decade ago by Joncom

Depending on what you're going for...

var factor = 0.8;

// Increase size by 80%
this.size.x += this.size.x * factor;
this.size.y += this.size.y * factor;

// Or...

// Resize to 80% of original size.
this.size.x = this.size.x * factor;
this.size.y = this.size.y * factor;

1 decade ago by lazer

I wrote a blog post about doing this a while ago. Haven't done it in a while, but should still be relevant with newer Impact versions (I would assume):

http://liza.io/making-a-player-grow-as-they-eat-stuff-in-impactjs/

(Edit: wow, I just noticed this thread is a year old.)

1 decade ago by TommyBs

Yeah there seems to be some spam of people not reading questions and just promoting their tools by the looks of it and it's bumping old posts to the top
Page 1 of 1
« first « previous next › last »