Making a Space Shooter game
-
- Posts: 7
- Joined: Tue Feb 06, 2007 1:30 am
Making a Space Shooter game
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?
And about flying? I just make a camera move behind the cockpit?
-
- Posts: 448
- Joined: Tue Oct 05, 2004 3:24 am
- Location: Boston, MA
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>
Learn the basics at </dream.in.code>
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
About flying and camera look here:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=4680
-
- Posts: 7
- Joined: Tue Feb 06, 2007 1:30 am
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?
How can I make a sphere with polygoons facing inside?
And about the HUD? It´s simple to make some kind of Radar?
Yes.
Depend on 3D modeling program you use. Look at its manual.How can I make a sphere with polygoons facing inside?
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.And about the HUD? It´s simple to make some kind of Radar?
-
- Posts: 7
- Joined: Tue Feb 06, 2007 1:30 am
-
- Posts: 1029
- Joined: Thu Apr 06, 2006 12:45 am
- Location: Tennesee, USA
- Contact:
-
- Posts: 7
- Joined: Tue Feb 06, 2007 1:30 am
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?)
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;
}
-
- Posts: 1029
- Joined: Thu Apr 06, 2006 12:45 am
- Location: Tennesee, USA
- Contact:
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
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.
And if they are reached you're ship would burn to pieces and die anyways
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.
-
- Posts: 7
- Joined: Tue Feb 06, 2007 1:30 am