Pre-Order the Game!

Desura Digital Distribution

Tuesday, February 28, 2012

Line and Circle working!

I sat down and looked at the screenshot from previous post, and saw something suspicious. I then took a look, and my suspicions was confirmed.

I changed from this:

X, X

to this:

X, Y

And lo and behold! The line vs circle collision works perfectly with that one change! A bug from copy/paste...

Now I can finally show what I'm talking about! Here's a bunch of screenshots:

A ship's shield is powerful enough to withstand a beam:

A ship's shield is barely strong enough to stop the laser on its second penetration:

A ship's shield is unable to stop the beam at all:

Multiple ships lined up are able to stop the beam after several shield penetrations:

A ship with two different shields (one short and one long range):

Whew! There's still two more things I need to add: cooldown between each particle (if you have 10 laser cannon, have it fire 10 times with about .1 second delay, instead of firing it all at once), and ability to set spawn conditions from inside the script (position and angle). For now, I'm done with this, next up is the tutorial system!


  1. First impression: that is really freaking cool!

  2. Ditto to Suspense's comment...

  3. I've been absent for a few months and I like all these updates!

    Space combat looks cool! Like idea of long range shields very much. Though I don't know how will you make AI play that :)

    I've tried to make physics logic couple times and it was not never efficient way of using development time. First for platformer, rectangles vs rectangles worked OK, but triangles were hell. Collision detection was fine but collision resolution refused to work. Then I worked on Starscape-like isometric shooter, made physics with circles only. It worked in the end but was hell to test and we had no idea how to effieciently make a beam projectile that way. And last time it was for tower defense, capsule vs capsule. That was actually successful. Capsules or tubes, as some call them are kind of moving circle, worm-like shapes. Those are good for describing both compact and elongated shapes. But in the end I'd rather resort to third party library that is tested, that works and has other performance goodies such as oct-trees (or other kind space partitioning).

  4. Line vs circle logic isn't really difficult, but the hard part was finding the points where it actually intersects. Most algorithms just returns true if a line intersects :D

    The physics part is now done (at least until circle vs circle for ramming ships), so next thing is ship taking damage and dying.

    Glad you like the space combat!