Asteroids-style momentum and turning controls?

0 favourites
  • 6 posts
From the Asset Store
Pack of illustrator graphic styles. Make your own logos, game titles, or anything you want.
  • For my first little project I just want to make an Asteroids clone. I'm using the Car behaviour at the moment, but it doesn't allow for rotation unless the object is accelerating (i.e., can't move in one direction, then spin and face the other way to fire behind you).

    Any ideas?

  • You should use the 8 direction behavior instead of car.

    Fimbul also released a custom spaceship movement behavior a long time ago. It might be worse having a look at it.

    Also check the wrap behavior (if you haven't already), it's a "classic" of asteroid's mechanics.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm using wrap right now. I tried fidgeting with the Car behaviour mechanics and got some degree of drift but it never felt right.

  • The spaceship movement is probably what you need. Couple it with the wrap movement and you're gold.

    If you run into any bugs with the behavior, report it in it's thread or PM me.

  • What I would do is use no behavior, and do it manually. It is very simple, you do not even have to use vectors!

    Instance variable: speed

    Every tick: move speed*dt pixels at ship.angle

    Every tick: set speed to self.speed * 0.something (if you want deceleration)

    Is right arrow down: rotate clockwise -something*dt degrees

    Is left arrow down: rotate clockwise something*dt degrees

    Is up arrow down: add something*dt to speed.

  • ...snip...

    that won't work. You'll make instant turns.

    You also won't be able to move in one direction while pointing at another (which is something the OP wants to achieve).

    The only way out is to use vectors, or use my behavior which does that for you (plus it's faster, since it doesn't have to interpret events)

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