Help with sprite distortion/exponential speed

This forum is currently in read-only mode.
  • I guess this is not gonna sound very good being my first post in here and all, but oh well.

    I'm making a "Starfield" game in Construct: The player will move in 8 directions avoiding a series of "stars" which move to outside of the screen as they embiggen in order to give a "Moving through a starfield" effect.

    Now, I'm a little stuck in two little things:

    1.- In order to make the stars move, I'm using the Bullet Behaviour. Now, what event I need to use in order to make the sprites bigger as they move farther away from the center?

    2.- In order to give a better effect and a bit of a challenge, the bullet speed must be exponential. Is there a way to do this? (Ie: In the initial position, speed would be X. 10 pixels away, speed would be X*2. 15 away, X*4. 20 away, X*8 and so on)

    Thanks beforehand.

  • You might have the best results moving the stars with events - ie. using sin/cos to work out the position. I can't remember the exact math.

    Still, you could probably fake it fairly well by

    1) use Set Width/Set Height, and enter a formula involving the distance to the center eg. 0.1 * distance(.X, .Y, 320, 240) (assuming 320, 240 is the centre point where the star comes from). This means the width and height would increase by 1 pixel every 10 pixels it moved, for example.

    2) again it's probably not the correct formula for true 3D movement, but you could try Always - set speed to current speed + 100 * TimeDelta, or something. The speed will then increase by 100 pixels per second every second.

  • 1) Excuse the noob question, but... Where can I find the Set Width/Set Height?

    2) That's EXACTLY what I need, but "speed + 100 * timedelta" but Construct marks it as erroneous

  • 1) Excuse the noob question, but... Where can I find the Set Width/Set Height?

    They're actions in the Sprite object. If you don't know that, it sounds like you need to run through the Ghost Shooter tutorial in the Learn section.

    [quote:3ex2m0r7]2) That's EXACTLY what I need, but "speed + 100 * timedelta" but Construct marks it as erroneous

    The expression is 'pseudocode' - nobody on the forum knows your exact object names etc., so you'll generally just get an approxomation on here that you can't paste in. Use the object panel at the bottom of the parameters dialog to find the speed expression. It'll look something like: Sprite[Bullet].Speed

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • -snip-

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