Random sprite size with sine behavior

0 favourites
  • 8 posts
From the Asset Store
220 Food Sprites in 16x16 pixel size. Perfect for items for a retro style game.
  • 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

  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • Hehe perfect

    Thanks again, !

  • Closing, original report link is now a 404.

  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)