Size of Sprites

Get help using Construct 2

Post » Wed Jan 11, 2012 6:16 pm

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
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Wed Jan 11, 2012 6:26 pm

Fixed

Events work by filtering specific instances that meet some conditions. The actions then run for those instances only.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,786

Post » Wed Jan 11, 2012 6:30 pm

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....
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Wed Jan 11, 2012 6:44 pm

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)
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,786

Post » Wed Jan 11, 2012 7:05 pm

Thanks again....especially for the link
B
42
S
19
G
12
Posts: 723
Reputation: 13,911


Return to How do I....?

Who is online

Users browsing this forum: Draconinho, totoe and 9 guests