Random sprite size with sine behavior

Bugs will be moved here once resolved.

Post » Sat May 24, 2014 5:02 am

Problem Description
I have a sprite that spawn with random size. but when I put the sine 'size', the sprite always spawn with the default size.

Attach a Capx
https://dl.dropboxusercontent.com/u/191 ... nebug.capx

Description of Capx
A simple example of the problem.

Expected Result
Sine could not reset the sprite size to the default value.

Affected Browsers
  • Chrome: (YES)
  • FireFox: (YES)
  • Internet Explorer: (YES)

Operating System and Service Pack
Windows 8.1

Construct 2 Version ID
r170
Last edited by Zathan on Mon Jun 02, 2014 5:58 pm, edited 1 time in total.
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Sat May 24, 2014 5:41 am

So, I know this isn't a solution for the bug, but it is a good workaround. See the attached capx.

Use a separate controller to hold the sine behavior off screen. Then multiply the size of the sprite you want re-sizing by the difference in the original controller size and the current controller size.
You do not have the required permissions to view the files attached to this post.
B
39
S
12
G
11
Posts: 331
Reputation: 7,727

Post » Sat May 24, 2014 5:55 am

FragFather wrote:So, I know this isn't a solution for the bug, but it is a good workaround. See the attached capx.

Use a separate controller to hold the sine behavior off screen. Then multiply the size of the sprite you want re-sizing by the difference in the original controller size and the current controller size.

Thank you, dude :)
It's a very good workaround.
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Sat May 24, 2014 7:43 am

@Zathan
You're welcome. Also, I decided to play with it a little more and came up with another work around you may like even more. Instead of adding another sprite object, this method uses 2 instance variables on the red sprite. Aside from that, it is pretty much the same. Take a look at the attachment. This method is better because each individual object has all the information it needs to handle the re-sizing.
You do not have the required permissions to view the files attached to this post.
B
39
S
12
G
11
Posts: 331
Reputation: 7,727

Post » Sat May 24, 2014 9:16 pm

Hehe perfect :)
Thanks again, @FragFather!
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Mon Jun 02, 2014 2:57 pm

Closing, original report link is now a 404.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Mon Jun 02, 2014 5:52 pm

Ashley wrote:Closing, original report link is now a 404.

Yup, sorry... I can upload again if you want.
Do you understand the problem, Ashley? It's a bug?

edit: link updated.
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Thu Jun 05, 2014 1:53 pm

Closing as not a bug: by the time 'start of layout' runs the objects have already been created and the Sine behavior has already chosen the size that it will oscillate at, and then it overrides anything you set later on. You should be able to work around this using the 'set magnitude' action etc.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest