Finally Starting Shooter For My Final In Class...

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

Post Reply
User avatar
davidthefat
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 529
Joined: Mon Nov 10, 2008 3:51 pm
Current Project: Fully Autonomous Robot
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: California
Contact:

Finally Starting Shooter For My Final In Class...

Post by davidthefat »

:roll: I remember making a thread long time ago that I needed to start my final for my AP class... but never got started.

I just DLed Code::Blocks and got rid of DevC++ today, and I got it to set up SDL right and blah blah... Now I drew up the Class lay out thing and I am ready to get started.

Image

I was thinking of doing destructible environment similar to Space invaders, like how they did it with the shields.

The game will be a top down view shooter similar to endless war (http://www.maxgames.com/game/endless-war-4.html) but not as hectic and bigger maps and ect.

So far I think I have to focus on formatting the classes right, since last attempts failed and had to reformat. I think the draw class will have a constructor that loads the sprite sheets. So a new draw object has to be initialized for the enemies and players and map. Would you say that its the wisest choice? or have the individual classes have their own sprite stored in as an object and have the draw function take in the coordinates and the SDL_Surface as arguments? I personally don't like functions taking in more than 3 arguments though...

Also how would I go about rotating the player in 360 degrees? I was thinking of making a sprite for every 22 degree angles and getting the slope of the mouse and the player and getting the tan of that, but that will use up more memory. I won't be venturing into OpenGL, I tried, I got lost...
User avatar
davidthefat
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 529
Joined: Mon Nov 10, 2008 3:51 pm
Current Project: Fully Autonomous Robot
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: California
Contact:

Re: Finally Starting Shooter For My Final In Class...

Post by davidthefat »

Image


Hopefully you can understand why the red is bad... Well If I get the slope of a coordinate with both negative x and y coordinates, it will come up as a positive, which will get a false reading with the inverse tangent function... So I will have to flip it if the y coordinate is negative, less hassle than checking the x axis
quickshot14
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 31
Joined: Thu Mar 11, 2010 2:51 am
Current Project: VB.NET Direct X Game Engine (Working Title)
Favorite Gaming Platforms: PC
Programming Language of Choice: VB.NET (for now)
Location: Nebreska, USA
Contact:

Re: Finally Starting Shooter For My Final In Class...

Post by quickshot14 »

You got a nice plan here and a great project, yes negtives when dealing with anything collesion or calculation wise is always a problem. Most just go around it, (as with tilescrolling for example) sometimes you have to deal with it, particluarly when dealing with something such as pyshics or just 3d space obviously. Anywayz looks like a great plan and very neat stuff, best of luck of you with it and keep us informed! Finshed final or not anywork you do only can expand your knowledge of gaming deign/programming and well thats a good thing imo :)
Amatuer Game Design/Programmer & College Student (Kaplan University: Associate of Applied Sceince in Information Technology: Application Devleopment)
Know Programming Languages & Considered Levels Of Programming in them: Basic(DOS) - 10%, VB(Legacy) - 15%, VB.NET - 55%, C/C++ - 1%, C# - 1%, LUA - 25%, Java - 0%, COBOL - 0%
________________________________________________
Current Game Development/Programming Projects:
VB.NET Direct X Game Engine (Working Title) - (Lanugage: VB.NET | Released Type/Status: Open Soruce / Unreleased)
________________________________________________
Quicks14Blog (My Gaming Related Blog Page) - My Youtube Channel Page
User avatar
davidthefat
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 529
Joined: Mon Nov 10, 2008 3:51 pm
Current Project: Fully Autonomous Robot
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: California
Contact:

Re: Finally Starting Shooter For My Final In Class...

Post by davidthefat »

A quick write up of the degree function

Code: Select all

double GetDeg(int PlayerX, int PlayerY, int MouseX, int MouseY)
{

//Get the Slope of the line
double Slope = (PlayerY - MouseY) / (PlayerX - MouseX);

if (MouseY > PlayerY)
{
return atan(Slope);
}

else if (MouseY < PlayerY)
{
return 360 - atan(Slope);
}

else if (MouseY == PlayerY && MouseX > PlayerX)
{
return 0;
}

else if (MouseY > PlayerY && MouseX == PlayerX)
{
return 90;
}

else if (MouseY < PlayerY && MouseX == PlayerX)
{
return 270;
}

else return 180

}

Fixed my code... Remember, just pulling it out of my ass ATM
User avatar
davidthefat
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 529
Joined: Mon Nov 10, 2008 3:51 pm
Current Project: Fully Autonomous Robot
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: California
Contact:

Re: Finally Starting Shooter For My Final In Class...

Post by davidthefat »

What is a better way to draw objects into the screen? The draw class has a constructor that takes in a file and loads the image on a SDL_Surface in the class or have a function that takes in an array of SDL_Surfaces and the index of the image and draw those on the screen? So the Player and Enemy Classes both have their own array of images
User avatar
RyanPridgeon
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 447
Joined: Sun Sep 21, 2008 1:34 pm
Current Project: "Triangle"
Favorite Gaming Platforms: PC
Programming Language of Choice: C/C++
Location: UK
Contact:

Re: Finally Starting Shooter For My Final In Class...

Post by RyanPridgeon »

It's best not to have each entity hold their own set of SDL_Surface's, because then when you have loads of enemies you'll be wasting loads of memory on duplicate images. You need a design where each actor can share images to save RAM :)
Ryan Pridgeon
C, C++, C#, Java, ActionScript 3, HaXe, PHP, VB.Net, Pascal
Music | Blog
Post Reply