Allegro.cc - Online Community

Allegro.cc Forums » The Depot » Product of boredom ... Asteroids!

This thread is locked; no one can reply to it. rss feed Print
 1   2 
Product of boredom ... Asteroids!
23yrold3yrold
Member #1,134
March 2001
avatar

I always wanted to make an Asteroids clone, and the engine for it is pretty much done now. I was going to call it "Cookie Crumble", change the asteroids to cookies, and give you a choice of playing as Steve Terry, Peter Hull, Richard Phipps and Trumgottist, but that's too much work for something that's only supposed to be a break from TMS (which I will now be getting back to). :) So it's not terribly pretty, but eh.

There's lots left to be done, all listed at the top of the .cpp file. Plus the code is probably a bit sloppy and inefficient, but who cares; it's friggin' Asteroids :) Cool parts include getting the guns and engine positioned correctly on the ship at any angle (thanks to some tricky matrix math), particle engine (basically the template one I posted many moons ago) and a cool twist I've never seen in an asteroids clone; a camera that follows the player (press 2 at the "main menu"). I'm sure someone's done it since it's so obvious a thing to add, but I've never seen it before. I likes it.

I'll make it a full, "proper" game some time later, probably when TMS is done. It can also be used for a more complex game I had planned (Asteroids gameplay, but with bigger playfield (hence the scrolling functionality) and some RPG trappings), as well as that Solar Jetman clone I'm always dreaming of doing :) I'm pretty much done with it for the moment though. Full source and a Win32 binary are attached. Post comments/suggestions, please :)

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

CGamesPlay
Member #2,559
July 2002
avatar

You can't die. Oh, and please put the entire folder in the zip file, not all the files in the root :) But, I like the scrolling and the camera :) And the engine :) Has potential :)

[edit]
I see your 4 smilies, and raise you 2 :):)

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

You can't die

I know; it's in the aforementioned to-do's :) Hitting an asteroid just brings up a white rectangle "alert" ...

Quote:

Oh, and please put the entire folder in the zip file, not all the files in the root

Sorry; it's a bit of trouble to organize it properly and barely anyone else around here does ;)

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

and barely anyone else around here does

/me changes the world, one quick demo at a time :)

[edit]
I match your 2 smilies and call. :P

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Flecko
Member #566
August 2000
avatar

Pretty cool for a quick asteroids clone Chris. The particle effect for the thrusters is pretty sweet. It's a nice effort, and as you said, no need to finish it now.

It seems pretty good for what it is,
-Flecko

ben's drivel
A shark on whiskey is mighty risky, but a shark on beer is a beer engineer. This message brought to you by Old Kentucky Shark of Kentucky Nightmare Whiskey Co.

X-G
Member #856
December 2000
avatar

And that's the way the cookie crumbles ...

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

DanielH
Member #934
January 2001
avatar

It was great, but I think that when you hit a boulder it should maybe flash better. All it did was flash black like once. Maybe like other games where it flashes transparent.

Also the really large boulders might be too big for the game.

Just suggestions.

23yrold3yrold
Member #1,134
March 2001
avatar

But I liked the big boulder :) Anyway, the hit flicker was just temporary (it doesn't turn black; it vanishes); I didn't feel like buggering with tinting the asteroid white or anything at the moment. Bells and whistles like that I'm saving for later, but keep the suggestions coming :)

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

CGamesPlay
Member #2,559
July 2002
avatar

So the asteroids flicker much too quickly on purpose? I thought it was a problem with your rendering...

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

23yrold3yrold
Member #1,134
March 2001
avatar

No; the program is just set up so that if hit by a bullet, the asteroid isn't drawn next frame. Nothing fancy, but it works. What would you prefer?

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

kazzmir
Member #1,786
December 2001
avatar

not to bad. i like your coding style :). btw, what does adding throw() to a function do since you arent throwing anything in the function?

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

What would you prefer?

I don't know, just firing at the speed you do, it flicker's rather much... Maybe a simple sound or small explosion sprite? :)

[edit]
Along the lines of the asteroid/asteroid collision, how about floating TNT barrels that when you shoot them damage asteroids and also send them flying in random directions?

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

btw, what does adding throw() to a function do since you arent throwing anything in the function?

Just tells you the function doesn't throw. I C&P the particle system class from another program; just ignore that ;)

CGP: I know; I'd like to have a little particle reaction when a bullet hits an asteroid. Another one in the to-do list :)

Quote:

[edit]
Along the lines of the asteroid/asteroid collision, how about floating TNT barrels that when you shoot them damage asteroids and also send them flying in random directions?

In outer space. Riiiiiiiight. ;)

I don't want to crowd the screen with too much junk. How about asteroids made of different materials, like one type which is volatile and causes area damage when it goes boom (and possibly hurts you if you're too close? ;))

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Paul Pridham
Member #250
April 2000
avatar

No screenshot, no download! :P

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

No screenshot, no download! :P

Attachment! ::)

You don't need a screenshot; it's freakin' Asteroids :P

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Richard Phipps
Member #1,632
November 2001
avatar

Since when have I been a cookie? ::)

I'll have a look at this later I think...

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

You don't need a screenshot; it's freakin' Asteroids

Uh... Yes, A screen shot would have been nice. You see alot of programers fall on the lazy side of the well known "lazyness/hurbis" thing programers are aflicted with.

I like to see if the game looks ok before trying to download, compile, and then run...

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

23yrold3yrold
Member #1,134
March 2001
avatar

Yes, but the only place I can put a screenshot is on GeoCities, and I don't like abusing the ability to post images from there here more than I have to :)

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

lambik
Member #899
January 2001
avatar

Why not post it as an attachment?

kazzmir
Member #1,786
December 2001
avatar

{"name":"asteroids.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/f\/1f6e7f44e6f56b3efdc2ef260eb08e5d.jpg","w":640,"h":480,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/1\/f\/1f6e7f44e6f56b3efdc2ef260eb08e5d"}asteroids.jpg

Richard Phipps
Member #1,632
November 2001
avatar

the_y_man
Member #1,770
December 2001
avatar

heh, it would be cool if the ship could have built in macros shuch as:

follow target
orbit target

and stuff like that, nice stuff btw.

23yrold3yrold
Member #1,134
March 2001
avatar

Quote:

Why not post it as an attachment?

Because the program was the attachment :) In hindsight, I could have submitted it as an IotD ...

Quote:

heh, it would be cool if the ship could have built in macros shuch as:

follow target
orbit target

and stuff like that, nice stuff btw.

Elaborate?

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

X-G
Member #856
December 2000
avatar

Quote:

Because the program was the attachment

Eight posts - eight potential attachments. ;)

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Trezker
Member #1,739
December 2001
avatar

The roving??? camera is good.
It's nice, for a product of boredom.

I also made a quick thing yesterday, not from boredom but beacause a friend gave me an idea.
I'll show it some day if I remember...
It actually has a problem I'd like someone to solve.
It's puting pixels along a path rendered by a wheel inside a circle thingy, and I want it to be as fast as possible without skipping pixels.

 1   2 


Go to: