warning: Creating default object from empty value in /home/buckman/public_html/neo/modules/taxonomy/ on line 33.
Matt Barton's picture

Dev Diary 024: Two Player Dog Fight

Two Player!Two Player!This has been a rough day for me! I finally got my space duel game working with two players. That is, it worked fine in the EDITOR. However, when I made a build of it, the fire buttons wouldn't work! I spent hours looking into the input functions to no avail. Finally, I discovered the problem had something to do with the update speed of the editor vs. the build. I'm still not exactly sure what the problem was, but it had something to do with the way I instantiated and positioned the bullets. I figured I'd check to see which fire button was pressed, then check to see where the corresponding ship was located. The big complication here is that I need to impart an initial velocity (set by each player) to their bullets. But how to get the right variable to the bullet? I'll spare you the details, which I don't really understand, but the short of it I managed to kludge through it.

At any rate, I think there's enough here for you to finally see my vision for the gameplay. You've got a two-player dog fight, ships orbiting the planets. Each time you fire, there's a cooldown period before you can fire again. You have to hit the enemy ship head-on to blow it up, and, yes, you can blow yourself up if you're not careful.

The keys are below:

Matt Barton's picture

Dev Diary 023: Procedurating Solar Systems

Sparkles!Sparkles!The ol' dev diary has been quiet lately as I had some very tough times getting over the next hump of my gravity game. By the way, how does "Outlaws of Gravity" strike you as a title? Little play on "Law of Gravity." But, anyway, I've been busy trying to make a system for procedurally generating the solar system, giving you a random distribution of planets and moons. Of course, later on I'll add some different textures for the planets, so that they don't all look the same.

I had a really tough time with the moons. I don't want them to be smashing into planets or each other, so I had to keep spacing out the planet orbits more and more, until finally it just wasn't practical. I went down a dead end of just making them decorative. Didn't like that, so went back to the old way. Finally, decided I just had to limit the number of them. I originally wanted three as the max, but just wasn't feasible unless I really went big with the resolution. I'm still not really happy about the moons. I think they're cool, and make it more realistic, but they don't seem to serve much purpose. I guess one strategy could be trying to put your ship right next to one, so that hopefully it might catch a bullet. Other than that, I don't see a point, so I might end up taking them out. IIRC, they didn't have them in gravity wars anyway.

Matt Barton's picture

Dev Diary 022: Gravity Balls!

Fun with gravityFun with gravityHaha! Man, it's such a beautiful thing when stuff comes together. I had a lot of issues getting this to work. Again, I'm suffering from my lack of math skills with this. I guess I should quit whining and just buy some videos from the Teaching Company, but thankfully I was able to find the formulas worked out by somebody else. Some copying, pasting, and tweaking, and viola! Gravity balls! I still have a long ways to go, obviously, but I think there's already enough here for you to give this a spin and see if it's something you'd enjoy.

Syndicate content