Making a Space Shooter game

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
leonardoaraujo.santos
Posts: 7
Joined: Tue Feb 06, 2007 1:30 am

Making a Space Shooter game

Post by leonardoaraujo.santos »

Hi , does someone knows how can I make the space effect in a Space Shooter games... Those stars in horizon that you never reach?

And about flying? I just make a camera move behind the cockpit?
Joe_Oliveri
Posts: 448
Joined: Tue Oct 05, 2004 3:24 am
Location: Boston, MA

Post by Joe_Oliveri »

I would say Build an unreachable sky box. That way no matter how far you are off the ground you are it will look the same.
Irrlicht Moderator || Game Designer
Learn the basics at </dream.in.code>
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

or make sky sphere, which you can call star sphere. Should be simple sphere with polygoons facing inside or backface culling turned off. Apply star texture on it and keep it centered around your camera.

About flying and camera look here:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=4680
leonardoaraujo.santos
Posts: 7
Joined: Tue Feb 06, 2007 1:30 am

Post by leonardoaraujo.santos »

So this sphere should have a texture of the stars and it has to move with my spaceship... and all of moving objects (Another spaceship, or planets) would just enter in this sphere when they come close?

How can I make a sphere with polygoons facing inside?

And about the HUD? It´s simple to make some kind of Radar?
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

Yes.
How can I make a sphere with polygoons facing inside?
Depend on 3D modeling program you use. Look at its manual.
And about the HUD? It´s simple to make some kind of Radar?
you can use 2D drawing functions like draw2DPolygon in video::IVideoDriver class or you can create texture, update it in real time and eighter draw it on screen as 2D or put it on some 3D object.
leonardoaraujo.santos
Posts: 7
Joined: Tue Feb 06, 2007 1:30 am

Post by leonardoaraujo.santos »

Thanks guys! :D Another questions. I`ve searched the forum and found that is simpler to create a space dome using ISceneManager::addSkyBoxSceneNode

But if I want to use particle systems do make this effect? How can I do it?
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

smgr->addSkyDomeSceneNode(...);

Check the docks for more information, only requires a texture.
Alternatively you can use addSkyBoxSceneNode(...);

But thats if you have one for top, bottom, left, right, back, and front
leonardoaraujo.santos
Posts: 7
Joined: Tue Feb 06, 2007 1:30 am

Post by leonardoaraujo.santos »

Thanks Monkeycracks, its realy easiest to pass only one file.

Talking about the particle systems way, I found a code that emulated rain using particle systems?

Do you know how can I use particle systems to make the stars dome effect?

Oh ... the code for the rain is here (Maybe the stars effect is done with a particle system without gravity?)

Code: Select all

/* Rain Effects by Srini*/ 
#include "stdafx.h"
#include <irrlicht.h> 

using namespace irr; 
using namespace core; 
using namespace scene; 
using namespace video; 
using namespace io; 
using namespace gui; 


#pragma comment(lib, "irrlicht.lib") 

scene::ICameraSceneNode* camera = 0; 

int main() 
{ 

IrrlichtDevice *device = createDevice(video::EDT_DIRECT3D9, 
core::dimension2d<s32>(640,480), 
32, false, true ); 

video::IVideoDriver* driver = device->getVideoDriver(); 
scene::ISceneManager* smgr = device->getSceneManager(); 


scene::ISceneNode* node = 0; 

scene::IAnimatedMesh* mesh = smgr->addHillPlaneMesh("Hill", 
core::dimension2d<f32>(20,20), 
core::dimension2d<s32>(20,20), 0, 20, 
core::dimension2d<f32>(2,2), 
core::dimension2d<f32>(1,1)); 




scene::IParticleSystemSceneNode* ps = 0; 
ps = smgr->addParticleSystemSceneNode(false); 
ps->setPosition(core::vector3df(-160,170,80)); 
ps->setScale(core::vector3df(1,1,1)); 

ps->setParticleSize(core::dimension2d<f32>(5.0f, 5.0f)); 

scene::IParticleEmitter* em = ps->createBoxEmitter( core::aabbox3d<f32>(-270,-200,-270,270,300,300), core::vector3df(0.00f,0.00f,0.0f), 400,800, video::SColor(0,255,255,255), video::SColor(0,255,255,255), 8000,10000); 

ps->setEmitter(em); 
em->drop(); 

scene::IParticleAffector* paf = ps->createGravityAffector(); 

ps->addAffector(paf); 
paf->drop(); 

ps->setMaterialFlag(video::EMF_LIGHTING, false); 
ps->setMaterialType(EMT_TRANSPARENT_ADD_COLOR); 
ps->setMaterialTexture(0, driver->getTexture("Raindrop.bmp")); 
ps->setMaterialType(video::EMT_TRANSPARENT_VERTEX_ALPHA); 





scene::ISceneNode* skyboxNode = smgr->addSkyBoxSceneNode( 
driver->getTexture("irrlicht2_uzerp.bmp"), 
driver->getTexture("irrlicht2_up.jpg"), 
driver->getTexture("irrlicht2_lf.jpg"), 
driver->getTexture("irrlicht2_rt.jpg"), 
driver->getTexture("irrlicht2_ft.jpg"), 
driver->getTexture("irrlicht2_bk.jpg")); 

device->getCursorControl()->setVisible(false); 

camera=smgr->addCameraSceneNode(0, vector3df(-50, 100, -100),vector3df(0, 0, 250)); 

ps->setParent(camera); 
int lastFPS = -1; 

core::vector3df Pos = camera->getPosition(); 
while(device->run()) 
{ 
driver->beginScene(true, true, 0); 

smgr->drawAll(); 

driver->endScene(); 

core::stringw str = L"Rain Effects By Srini"; 
str += driver->getName(); 

} 

device->drop(); 

return 0; 
}
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

Well the stars will never be reached right? They'll always be a part of the background.

And if they are reached you're ship would burn to pieces and die anyways :P

Search online for a seamless star texture and use that in skydomescenenode

Otherwise, if you're doing a 'hyerdrive' or something of that sort just make a particle emitter at the front of the ship emitting stars towards the ship to make it seem like the ship is 'moving' through them.
leonardoaraujo.santos
Posts: 7
Joined: Tue Feb 06, 2007 1:30 am

Post by leonardoaraujo.santos »

Thanks again monkeycracks I will try to find some cool space-ship mesh and I will do some research on shooting ....

Do you have or know about some code that I can use to start?

I saw aras sample and found awsome but I want to make some cockpit hud
Post Reply