Page 1 of 2

Space Shooter thingy (WIP)

Posted: Fri Jul 17, 2009 3:47 pm
by Netwatcher
A Player VS Player space shooter.
Just thought it would be cool to make one, and it's an interesting learning experience.

The game will have:
2 Players PvP action.
Power-Ups.
Animated background.
Random enemy waves.(dunno if that's a good idea)

I'm using C++ with DirectX9

So far I've implemented the following:

A basic DirectX9 framework(graphics,audio,input(might end up using Win32 input))

A sprite class containing;
2D pos info, width and height(for collision), hp, and an alive bool(draw/do not draw the sprite)

2 players and controls.

A Dynamic-projectile-creation-system,
Which does the following:
Creates sprites in "on a need" basis in a vector(*).
Erases a sprite when it is no longer needed.
Renders the sprite.
Checks for collision.(well it partially does...)

*A vector container was used to create as many sprites as needed, and to delete them easily from the anywhere within the Vector.

all art was made by clsDevAaron.

Download link coming soon

Re: What The Space, a PvP space shooter (WIP)

Posted: Fri Jul 17, 2009 8:47 pm
by Netwatcher
Got the download link here

5 days into the development, a showcase of features.

http://www.mediafire.com/?zzmmnytmzyz


Included the VC++ redistributable, and the d3dx9_41.dll, it should work properly on all Windows machines.


Controls:

Player 1:
AWSD and Left Ctrl for shooting.

Player 2:
Arrow keys and right Ctrl for shooting.

*Known issues:
**Getting your ship off the screen and shooting will crash the game.

*Instead of random enemy waves there will be random Meteor Showers.

Re: What The Space, a PvP space shooter (WIP)

Posted: Sat Jul 18, 2009 9:32 am
by Netwatcher
This is the new "Capture the turd" mode, basically , you need to kill the enemy carrying the turd so he is no longer drawn, and the turd's Center matrix will become yours... have fun!



http://www.mediafire.com/download.php?mjmlnjmngem

Thanks to clsDevAaron for the turd.

*This is a practice in rotation matrices
*no win/lose situations

Re: What The Space, a PvP space shooter (WIP)

Posted: Sat Jul 18, 2009 9:37 am
by clsDevAaron
lmfao...thanks for putting my hard work to shame ._.

not my fault I suck when it comes to pixeling big stuff

Re: What The Space, a PvP space shooter (WIP)

Posted: Sat Jul 18, 2009 12:11 pm
by Netwatcher
On the contrary, you don't suck at all...
you drew a beautiful turd.

Re: What The Space, a PvP space shooter (WIP)

Posted: Sat Jul 18, 2009 3:33 pm
by Bludklok
In your movement function i'm guessing it looks something like this...

Code: Select all

if(key_d) move_right( player.x );

void move_right(int & x)
{
	x++;
}
In that case an easy way to fix the crash when the ship moves out of the screen would be to do this...

Code: Select all

void move_right(int & x)
{
	if(x < screen_width - length_of_ship_sprite) x++;
}

Re: What The Space, a PvP space shooter (WIP)

Posted: Sat Jul 18, 2009 3:49 pm
by Netwatcher
Bludklok wrote:In your movement function i'm guessing it looks something like this...

Code: Select all

if(key_d) move_right( player.x );

void move_right(int & x)
{
	x++;
}
In that case an easy way to fix the crash when the ship moves out of the screen would be to do this...

Code: Select all

void move_right(int & x)
{
	if(x < screen_width - length_of_ship_sprite) x++;
}

No, No, and Nooope, I did fix the problem, it had something to do with the projectile system erasing a non-existing element in the vector...
but I fixed that after a few hours and it's all good now. the projectiles were meant to erase themselves when they exit your FOV(which creates a conflict when the starting position of the projectile is already outside of the FOV).
Nothing to do with the ship lol, you can get outside of the screen only because I want you to...
just want to get the hard stuff done first

Re: What The Space, a PvP space shooter (WIP)

Posted: Sat Jul 18, 2009 3:56 pm
by Bludklok
Hmm but if the player can travel outside of the screen whats stopping them from getting lost?

Re: What The Space, a PvP space shooter (WIP)

Posted: Sat Jul 18, 2009 3:59 pm
by Netwatcher
Said im gonna take care of the hard stuff first, saving this child's play for the end.

and if you were wondering...

Edit: when I'll need to use velocity, I'll change it

Code: Select all

//Player One
if(Key_Down(DIK_W))//up
	{playerOne.y -= 5;}
	if(Key_Down(DIK_S))//down
	{playerOne.y += 5;}
	if(Key_Down(DIK_A))//left
	{playerOne.x -= 5;}
	if(Key_Down(DIK_D))//right
	{playerOne.x += 5;}
	if(Key_Down(DIK_LCONTROL))//shoot
	{Proj[0].CreateProjectile(playerOne.x+37,playerOne.y+25,20,5);Proj[0].Reload();}

//Player Two
	if(Key_Down(DIK_UP))
	{playerTwo.y-= 5;}
	if(Key_Down(DIK_DOWN))
	{playerTwo.y+= 5;}
	if(Key_Down(DIK_LEFT))
	{playerTwo.x -= 5;}
	if(Key_Down(DIK_RIGHT))
	{playerTwo.x += 5;}
	if(Key_Down(DIK_RCONTROL))
		
	{Proj[1].CreateProjectile(playerTwo.x+24,playerTwo.y+25,20,5);Proj[1].Reload();} //shoot    
Creating an UP/Down/Left/Right function is a waste of time for this...(only 1 instruction per function, which i can do faster like this)
Might be useful for a game with 20 different characters, then again, I can just change the image and the sprite is still playerOne/PlayerTwo

Re: What The Space, a PvP space shooter (WIP)

Posted: Sat Jul 18, 2009 4:30 pm
by Bludklok
If your going to have several different things moving you can just make a set of move_direction functions and use that instead of what your doing right now. Ultimately its up to you I guess but It's just how I would do it. ;)

Also it keeps all of that mess out of your game's main loop.

Re: What The Space, a PvP space shooter (WIP)

Posted: Sat Jul 18, 2009 6:11 pm
by Netwatcher
Bludklok wrote:If your going to have several different things moving you can just make a set of move_direction functions and use that instead of what your doing right now. Ultimately its up to you I guess but It's just how I would do it. ;)

Also it keeps all of that mess out of your game's main loop.
Yep, that's what I'm using for the projectiles.

ok... a new build

http://www.mediafire.com/download.php?on3lditodmk


Known Issues:
They game does not crash under any circumstances.



Controls:
Now the Arrow Keys control the Right player while the WASD keys control the Left Player.
*New* Press "P" to pause the game.
If you switch windows, the game won't get stuck and just pause.
Press F9 to generate random space turds Meteors.(again, the projectile class.. just added 7 new functions to it :D)
and F8 to clean the screen.

Re: What The Space, a PvP space shooter (WIP)

Posted: Sat Jul 18, 2009 7:33 pm
by Bludklok
Nice frame rate when there's a lot of sprites on the screen, I got my autoclicker + onscreen keyboard and spammed F9 in an attempt to make it crash. (Although it seems you limited the amount of meteors allowed on-screen at one time. Boo you.) :)

Re: What The Space, a PvP space shooter (WIP)

Posted: Sun Jul 19, 2009 3:34 am
by Netwatcher
I didn't, they just get off the screen and get un-rendered O_0 well that's what they're supposed to do

For extra meteor action press F9 & F11 :lol:

Re: What The Space, a PvP space shooter (WIP)

Posted: Sun Jul 19, 2009 6:35 pm
by Netwatcher
Thanks to help on IRC and a hell lot of time spent on reading the DirectX documentation, the engine now supports rotation.

Re: What The Space, a PvP space shooter (WIP)

Posted: Mon Jul 20, 2009 4:08 am
by Netwatcher
Got a little bored and played with stuff...
http://www.youtube.com/watch?v=24i-cD3E4Q8

P.S.
If you search for an "Exotic Fruit Engine" in youtube, this video is the 6th result
If you search for an "Exotic Fruits Engine" this is the 4th.