'Asteroids' style movement with walls?

0 favourites
From the Asset Store
9 orchestral + 9 alternate chiptune-style arrangements of dynamic, RPG-style music for your media project.
  • Neither of those behave the way I want ('Asteroids' style movement).

    You can tweak that car behaviour a lot, its default looks a lot what you made with the custom movement.

    Oh well, good luck :)

  • So the thread title should be "Asteroids style movement(ok not really), and oh by the way, the walls rotate for some unknown reason".

    Yeah, um, none of the standard behaviors will work for that.

    Try making your own with sin, and cos.

  • newt the movement is asteroid-style, the only difference is it should have collision.

    I never said the walls rotate, I just said that they can be at any angle.

    It's also difficult to make it manually because there's no good way to test the angle of the wall you're colliding with.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Its not much different than raycasting.

  • After fiddling with it a bit I don't find the custom behavior's push actions useful at all so I tried a few other methods. One that came to mind is to use the 8direction behavior instead and use events to set the horizontal and vertical velocities. It didn't work ideally since the 8direction often stops short of the walls if going too fast.

    If you're fine using boxes with no rotation for the walls for now here is a capx. It uses a simplified case of the Separating Axis Theorem to do the push out and wall sliding. I was using it in another capx and found it to be a very clean way to do the wall sliding. I'll try to extend it into a plugin one of these days if I get time.

    https://dl.dropboxusercontent.com/u/5426011/examples21/sat_push_aabb.capx

  • Its not much different than raycasting.

    One thing I have noticed (and not needed that long) about this forum is that people seem to assume that the game developing system can do all the *thinking* for them.

    Programs and toolkits like Construct, Unity etc. help carrying a lot of the burden and eliminate the lots of tedious ground work needed compared to coding the same game with C(++) or Javascript. But they aren't (at least yet) totally automated systems that can solve *everything* one may need during game making.

    So, there are still some human game making skills needed, like logic and trigonometry. And this one definitely need the trig (and some example drawings) to be solved.

  • Thanks newt for your raycasting suggestion, that's a good idea.

    I seem to have found a pretty good solution. Here's the capx for anyone interested.

    Basically, I cast two parallel rays, then use some simple trig to determine the angle of the wall. Once i know the angle of the wall, I just use 'push out solid at angle' in the opposite direction to the wall.

    It has problems with sharp inwards corners, but those can easily be fixed with some invisible collision if need be.

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