Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Geometry Wars Clone
Index -> Programming, C++ -> C++ Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
TerranceN




PostPosted: Sat Feb 20, 2010 12:12 pm   Post subject: Geometry Wars Clone

This is my final project for ICS 4UI, but I have added some stuff onto it, and I will be updating this when I have the time (aka after the CCC and Math competition).

I used Win32 and OpenGL to create this, and used code from Neon Helium (specifically lessons 1 and 13), although I have changed it in order to be OO.

NOTE : In order to save your highscore, the exe must not be in the zip.

NOTE 2 :This will only work at 1280x1024 (4:3) fullscreen right now. Once I get the menu finished it will be changeable in-game. If you need a different resoloution, just ask, or go into the source code and change the resoloution in main.cpp.

NOTE 3 :The code is horribly commented right now, I will comment it further when I have time.


Controls
W, A, S, D or UP, DOWN, LEFT, RIGHT -----------Movement
Left Click ------------------------------------Fire Bullets
P ---------------------------------------------Pause
Escape-----------------------------------------Exit to Main Menu


My best score : 191,200

What do you guys think and what should I name this (as I am horrible at coming up with even semi-decent names)? Also, if you find any bugs please let me know.



GeometryWarsCloneSource.zip
 Description:

Download
 Filename:  GeometryWarsCloneSource.zip
 Filesize:  4.14 MB
 Downloaded:  2441 Time(s)


GeometryWarsCloneBin.zip
 Description:

Download
 Filename:  GeometryWarsCloneBin.zip
 Filesize:  240.51 KB
 Downloaded:  782 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
TerranceN




PostPosted: Mon Mar 01, 2010 5:56 pm   Post subject: Re: Geometry Wars Clone

Update!

New Stuff
-Added menu input
-Can change resoloution
-Can save settings
-Automatically loads settings

In order to save your settings or highscore, you must first extract the exe. Sorry for how messy the code is. I should probably also mention that this was made in Microsoft Visual C++ 2010 Beta2.



GeometryWarsCloneSource.zip
 Description:

Download
 Filename:  GeometryWarsCloneSource.zip
 Filesize:  87.01 KB
 Downloaded:  596 Time(s)


GeometryWarsCloneBin.zip
 Description:

Download
 Filename:  GeometryWarsCloneBin.zip
 Filesize:  100.12 KB
 Downloaded:  508 Time(s)

SNIPERDUDE




PostPosted: Mon Mar 01, 2010 10:59 pm   Post subject: RE:Geometry Wars Clone

Being on a laptop with no proper mouse, I didn't get too far - but from I've seen it's pretty cool.
+bits
TerranceN




PostPosted: Thu Mar 18, 2010 10:16 pm   Post subject: Re: Geometry Wars Clone

Update!

Sorry it has been a few weeks since the last update, but I decided to take a break (until now), and my Microsoft Visual C++ 2010 Beta 2 got messed up when I uninstalled the C# 2010 Beta, requiring me to reinstall lots of stuff until I found the problem. Anyway...

New Stuff
-Added a score multiplier, you get +1% per kill, and you go back to 100% if you die.
-Added grid effects:
-----Grid is now distorted by your shots (it only has small effect with 1 bullet, it is best at 3+ bullets)
-----Grid has higher resolution
-----Grid now coloured to make 4x4 sections
-Enemies spawn slower
-When you die, you only loose 1 bullet per shot, instead of going back to 1.

Known Bug(s)
-After going fullscreen the desktop is the active window, you need to click on the game in order to play.
-I completely forgot to increment the version number in the window title before uploading... oh well.



GeometryWarsCloneSource.zip
 Description:

Download
 Filename:  GeometryWarsCloneSource.zip
 Filesize:  68.06 KB
 Downloaded:  566 Time(s)


GeometryWarsCloneBin.zip
 Description:

Download
 Filename:  GeometryWarsCloneBin.zip
 Filesize:  232.1 KB
 Downloaded:  437 Time(s)

SNIPERDUDE




PostPosted: Thu Mar 18, 2010 10:37 pm   Post subject: RE:Geometry Wars Clone

I much prefer Dev-C++, it doesn't give me nearly as many problems as Visual Studio does. Also, I like being able to create a file, and run it without having to create a project to go with it.
TerranceN




PostPosted: Thu Mar 18, 2010 10:45 pm   Post subject: Re: RE:Geometry Wars Clone

SNIPERDUDE @ Thu Mar 18, 2010 10:37 pm wrote:
I much prefer Dev-C++, it doesn't give me nearly as many problems as Visual Studio does. Also, I like being able to create a file, and run it without having to create a project to go with it.


For small projects and testing small chunks of code, I agree, but intellisense is very useful on more complicated projects (dev-c++'s intellisense is slow and not very smart; when I have a method with the same name in two different classes, it cannot tell the difference between them, and gives me the parameters for every Update method in the entire program, forcing me to go look at the header anyway). I did try at one point to switch to dev-c++ (so I could work on it at school), but it gave me some confusing error about iterators.
SNIPERDUDE




PostPosted: Thu Mar 18, 2010 10:51 pm   Post subject: RE:Geometry Wars Clone

I hardly stick to one IDE, but given that I'm typically working on smaller stuff for school I tend to lean toward Dev more often than not.
X Abstract X




PostPosted: Fri Mar 19, 2010 1:29 pm   Post subject: Re: Geometry Wars Clone

I'm posting simply because this deserves a post. Amazing work! Oh, and I was under the impression that ICS 4U was always taught using Java.
Sponsor
Sponsor
Sponsor
sponsor
TerranceN




PostPosted: Fri Mar 19, 2010 2:47 pm   Post subject: Re: Geometry Wars Clone

X Abstract X @ Fri Mar 19, 2010 1:29 pm wrote:
I'm posting simply because this deserves a post. Amazing work! Oh, and I was under the impression that ICS 4U was always taught using Java.


It was taught with Java, but my teacher was very lenient, letting use any language we wanted for our summative, and I honestly hate not having pointers and operator overloading, so I decided to use a different language. I only chose C++ because of the awesome openGL tutorial on http://nehe.gamedev.net/, but in retrospect I am finding C# a much more programmer friendly language, and would use that if I create another large-ish project.
SNIPERDUDE




PostPosted: Fri Mar 19, 2010 4:09 pm   Post subject: RE:Geometry Wars Clone

Each to their own I guess, given the choice I'd take C++ over C# (and definitely over Java). And Python over C++.

But having looked at that tutorial you linked, that was exactly what I was looking for, thanks.
Sur_real




PostPosted: Sun Mar 21, 2010 6:19 pm   Post subject: RE:Geometry Wars Clone

Java in ICS 4U, what did you guys learn in 3U then? Cuz I was taught Java in 3U and PHP now in 4U
I guess you probably learned more advanced Java or something Very Happy
TerranceN




PostPosted: Sun Mar 21, 2010 7:15 pm   Post subject: RE:Geometry Wars Clone

It's a little complicated...

My school is very new, and because of that, we did not have a very knowledgable computer science teacher, but it is not his fault, it was him or no computer science class. Anyway, he taught us Turing for ICS 3U; right from a word doc, giving us a week worth of programs on even the most basic stuff (whoops going a little off topic). But this year they 'restructured' the program, and we got a new teacher, which ended up in ICS 3U and 4U being taught Java. Sadly that meant the 4U barely learned anything more then 3U (we did not even 'learn' objects Sad).

So we did not learn Java in 3U, and we did not learn more advanced Java in 4U, but future students probably will.
neoaikon




PostPosted: Sat Apr 10, 2010 9:31 am   Post subject: Re: Geometry Wars Clone

I love this submission, it's a shame so many other clones have gotten taken down off the web.

Looking through the source code, I found one little error. When steering the ships toward the player's ship, if you notice the movement is somewhat snakelike. This is because when clamping the velocity on the baddies, you don't normalize the clamp values. This means to the baddies having a diagonal velocity >5.
code:
float angleToPlayer = atan2(playerPos.Y - position.Y, playerPos.X - position.X);

velocity.X += cos(angleToPlayer);
velocity.Y += sin(angleToPlayer);

HelperFunctions::CapFloat(velocity.X, -5.0, 5.0);
HelperFunctions::CapFloat(velocity.Y, -5.0, 5.0);


The fix is simple:

code:
float angleToPlayer = atan2(playerPos.Y - position.Y, playerPos.X - position.X);

velocity.X += cos(angleToPlayer);
velocity.Y += sin(angleToPlayer);
[b]Clamp.X = cos(angleToPlayer);
Clamp.Y = sin(angleToPlayer);
Clamp.X = (abs(Clamp.X));
Clamp.Y = (abs(Clamp.Y));       [/b]

HelperFunctions::CapFloat([b]velocity.X, -5.0f * Clamp.X, 5.0f * Clamp.X[/b]);
HelperFunctions::CapFloat([b]velocity.Y, -5.0f * Clamp.Y, 5.0f * Clamp.Y[/b]);


This ensures the velocity is 5 in all directions. If you look at the difference you'll see the baddies smoothly track toward the player.
ScaryRat




PostPosted: Sun Apr 18, 2010 5:42 pm   Post subject: RE:Geometry Wars Clone

How do I open this project? Theres no SLN file.

Sorry I'm noob. xD
TerranceN




PostPosted: Sun Apr 18, 2010 8:53 pm   Post subject: Re: Geometry Wars Clone

Sorry I have not updated this in almost a month, I have been busy with other things.

Thanks neoaikon, I often forget about the length of vectors being greater than their componenets (I also did this in my player class IIRC). I agree, it is a shame others have been taken down, but I have only heard of gridwars getting taken down, and I doubt mine will get as known as gridwars (and if it does, then I will just be happy for the recognition).

ScaryCat, I checked and there is a sln file there. AFAIK, you should be able to open the vcproj file anyway.

As for the game, I have only added a few grid effects and did some bug fixes, so I will wait for a bigger addition to remove all the stuff msvc puts in the source folder and release the source. Speaking of bigger additions, I have been working to get some audio in the game. I have written code that will work for this, I just dont have any sounds yet. Hopefully I can use my rockband mic to record some random noises (that dont kill your ears) before the end of next weekend. I have no idea when I'll get around to adding more enemies. Oh and my highscore is 1,020,198. Very Happy



GeometryWarsCloneBin.zip
 Description:

Download
 Filename:  GeometryWarsCloneBin.zip
 Filesize:  232.94 KB
 Downloaded:  575 Time(s)

Display posts from previous:   
   Index -> Programming, C++ -> C++ Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 25 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: