Size of Sprites Forum Home > Construct 2 General > How do I....? |
Post Reply
|
| Author | |
Post Options
Quote Reply
Topic: Size of SpritesPosted: 11 Jan 2012 at 6:16pm |
|
|
Hey Guys
I am not sure, if this is a feature or a bug, so I asking here if I am doing something wrong. The task is, to throw a Dart. To simulate the flight, I resize the sprite. When a new Dart is spawned, the Dart appears with the correct size, but the resize handling does not work as expected by the first dart. If you look at the textfield, you can tell, that the respawned sprite seems to have different width and height than the one on the screen. Here's the code: And the CAPX |
|
|
_____________________
You want help? Post your CAPX! virtus junxit mors non separabit |
|
![]() |
|
Post Options
Quote Reply
Posted: 11 Jan 2012 at 6:26pm |
|
|
Fixed
Events work by filtering specific instances that meet some conditions. The actions then run for those instances only. |
|
![]() |
|
Post Options
Quote Reply
Posted: 11 Jan 2012 at 6:30pm |
|
|
Hey THX
I was somehow aware of this fact and thought I had covered it by the check for "Dart is visible" - but this seems to control the picking differently then the check of the state of an instance variable.... |
|
|
_____________________
You want help? Post your CAPX! virtus junxit mors non separabit |
|
![]() |
|
Post Options
Quote Reply
Posted: 11 Jan 2012 at 6:44pm |
|
|
Well the way you checked it was not enough.
'is visible' means the value visible of the sprite object is set to visible. Either small darts and flying ones are visible. But small darts made it also so throw was turned to 0 And since throw couldn't be >=1 anymore, then the instances did not shrink anymore. Adding instances variables and checking them the way I did is the way for me to differentiate "States" in my instances. What do I want : For as long as it is flying, I want my Sprite Dart to shrink, giving the flight impression. When the sprite reaches a certain size, I consider it to be planted (different state). It just has to stand there for now. It's also the good time to check what zone it is colliding with for the score ^^ You might also want to check out this topic (the whole topic is informative imo) |
|
![]() |
|
Post Options
Quote Reply
Posted: 11 Jan 2012 at 7:05pm |
|
|
Thanks again....especially for the link
|
|
|
_____________________
You want help? Post your CAPX! virtus junxit mors non separabit |
|
![]() |
|
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |