KamikazeBee (Game)

Developed or developing a new product in PureBasic? Tell the world about it.
u9
User
User
Posts: 55
Joined: Tue May 09, 2006 8:43 pm
Location: Faroe Islands
Contact:

KamikazeBee (Game)

Post by u9 »

I wanted to learn PureBasic, so I figured the best way was to make something. I sat down one weekend and this is the result. The game logic was done on the first day. The second day I added some nicer graphics, background, bullet, explosions, damage and of course no game is complete without sound.

The graphics come from PB and the sounds are royalty-free downloads from www.a1freesoundeffects.com/. The name is a merger of those crazy Japs as well as the BeeGee airplane which in it self was a bit crazy.

Requirements
  • PB v4 full. If you remove all the comments it will compile in demo version.
  • Windows OS. Sorry, I used 3D sprites which aren't available in Linux and Amiga.
How to play
Use the arrows to speed up or slow down the plane. Left ctrl to fire. This can be configured by changing the #fireKey constant at the top of the code. The objective is to shoot as many baddies as possible without wasting too many bullets. To quit press escape.

Downloads
Note: The downloads are NOT available at these url's at the moment. If you would like to thy this game, please send me a PM.
http://www.wirednerd.com/development/pu ... bee_v1.zip (~142kB) (old)
http://www.wirednerd.com/development/pu ... urrent.zip (latest release)

Any ideas for improvement?

EDIT: I've added a link to the latest release.
Last edited by u9 on Sun Sep 02, 2007 11:45 pm, edited 3 times in total.
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com
DarkDragon
Addict
Addict
Posts: 2345
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

Cool, well, you need to say PB 4 instead of PB 3.94.
bye,
Daniel
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

Nice!
I like logic, hence I dislike humans but love computers.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Very nice - my teenage gamer enjoys it :)

As a "commercial" programmer, this kind of stuff impresses me.

Thanks for sharing with the community.

cheers
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: KamikazeBee (Game)

Post by Comtois »

u9 wrote:Any ideas for improvement?
You can replace this

Code: Select all

ResetList( explosions() )
While NextElement( explosions() )

Wend
by this

Code: Select all

ForEach explosions()

Next
And this

Code: Select all

ResetList( explosions() )
While NextElement( explosions() )
   DeleteElement( explosions() )
Wend
by this

Code: Select all

ClearList(explosions()) 
BTW very nice game , well done :)
Please correct my english
http://purebasic.developpez.com/
u9
User
User
Posts: 55
Joined: Tue May 09, 2006 8:43 pm
Location: Faroe Islands
Contact:

Re: KamikazeBee (Game)

Post by u9 »

Comtois wrote:
u9 wrote:Any ideas for improvement?
You can replace this

Code: Select all

ResetList( explosions() )
While NextElement( explosions() )

Wend
by this

Code: Select all

ForEach explosions()

Next
And this

Code: Select all

ResetList( explosions() )
While NextElement( explosions() )
   DeleteElement( explosions() )
Wend
by this

Code: Select all

ClearList(explosions()) 
BTW very nice game , well done :)
Nice. Thanks for the info. One learns new things every day :) And thanks for the feedback everyone. I appreciate it.
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Re: KamikazeBee (Game)

Post by NoahPhense »

That's freakin great.. VERY nice.. keep it up!


- np
DarkDragon
Addict
Addict
Posts: 2345
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

The Collision is a bit weird, it sometimes works and sometimes not(You have to increase the bounding box or sphere or whatever you use)
bye,
Daniel
u9
User
User
Posts: 55
Joined: Tue May 09, 2006 8:43 pm
Location: Faroe Islands
Contact:

Post by u9 »

DarkDragon wrote:The Collision is a bit weird, it sometimes works and sometimes not(You have to increase the bounding box or sphere or whatever you use)
Yeah I know. It's just a circle. I thought of making two ellipses, one for the fuselage and one for the wings so they better fit the boundary of the plane, but maybe in the next version. It's a bit complicated (I think) to calculate the boundaries of an ellipse when it is rotated :shock: Maybe there are some good mathematicians around these neighborhoods...

EDIT: Well it's a bit complicated to calculate if two ellipses collide that is.
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com
u9
User
User
Posts: 55
Joined: Tue May 09, 2006 8:43 pm
Location: Faroe Islands
Contact:

Post by u9 »

DarkDragon wrote:The Collision is a bit weird, it sometimes works and sometimes not(You have to increase the bounding box or sphere or whatever you use)
I have updated the collision to using 4 circles instead of one. I still have a large circle around the entire plane (just so I only check the small circles if the two large circles intersect). You can see the circles by setting this constant to #True

Code: Select all

#SHOW_COLLISIONS = #True
At the top of the source code.

@Joakim Christiansen: You asked in another thread how to find the position of a bullet when the object (man/ship/plane/whatever) is rotating. You could have a look at the markCollision procedure. It creates the 4 circles, and draws them according to their angle around the plane. The assignments of x and y are actually the implementation of the matrix multiplication I showed you. Don't mind the inputs to the sin() and cos() functions. Their inputs should only be the angle of rotation of your object in radians (where 0 is to the right). After you have caluclated x and y you should negate y because on the screen the y-axis points downwards. You'll see I have done the same on line 660.

Hope it helps.

Download
Here's the new version: http://www.wirednerd.com/development/pu ... bee_v2.zip (~144kB)
Last edited by u9 on Tue Jun 27, 2006 11:49 am, edited 1 time in total.
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com
User avatar
Michael Vogel
Addict
Addict
Posts: 2807
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Post by Michael Vogel »

For all who don't have superfast internet access (maybe I'm not alone) it would be fine, if the engine3D.dll would be eleminated from the zip file (or for more comfort moved into an additional file for download)...
u9
User
User
Posts: 55
Joined: Tue May 09, 2006 8:43 pm
Location: Faroe Islands
Contact:

Post by u9 »

Oh, I'm sorry Michael. Of course the engine3D.dll is included in PB so it was quite stupid of me to include it in the download. What was I thinking? :oops: I have removed it and the file size is now only 144kB instead of over 600.

Sorry about that. Thank you for letting me know. Feedback is always welcome.
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

u9 wrote:Hope it helps.
I'll test it :)
I like logic, hence I dislike humans but love computers.
Post Reply