public InstantExplosionWeapon(string defaultPath, Camera camera) { if (sound == null) sound = new Sound(defaultPath + "Audio/laserfire3.wav"); this.reloadTime = 1000; this.damage = 10; Texture t = new BasicTexture(defaultPath + "Texture/Particle/p.png"); this.position = new Vector3f(); this.direction = new Vector3f(); pe = new PointEmitter(position); Vector3f maxV = new Vector3f(10.0f, 10.0f, 10.0f); Vector3f minV = maxV * -1.0f; Vector3f g = new Vector3f(0.0f, -0.001f, 0.0f); Color4f minC = new Color4f(1.0f, 0.7f, 0.7f, 0.0f); Color4f maxC = new Color4f(1.0f, 1.0f, 1.0f, 1.0f); pf = new BillboardedParticleFactory(t, minV, maxV, g, 0.0f, 1.0f, minC, maxC, 0.2f); ps = new ParticleSystem(pe, pf, camera, false, 0.1f, 1000); pe.setActive(false); ps.reset(); }
static void LoadObjects() { w.setSkyBox(new SkyBox(new CubeMapTexture(c.defaultPath + "CubeMap/sky0", CubeMapType.None))); crosshairPosition = new Vector3f(3.0f, 1.0f, 0.0f); w.Add(new HUD(c.defaultPath)); Vector3f va, vb, vc, vd; va = new Vector3f(-100.0f, 0.0f, -10.0f); vb = new Vector3f( 100.0f, 0.0f, -10.0f); vc = new Vector3f( 100.0f, 0.0f, 50.0f); vd = new Vector3f(-100.0f, 0.0f, 50.0f); w.Add(new GroundPlane(new BasicTexture(c.defaultPath + "Texture/Tile/chess0.jpg"), 70, 7, new Vector3f(0.0f, 0.0f, -5.0f), 200, 20.0f)); w.Add(gun); w.Add(gun2); playerPosition = new Vector3f(0.0f, 1.0f, 0.0f); playerVelocity = new Vector3f(); BasicTexture[] textures = new BasicTexture[8]; for (int i = 1; i <= 8; i++) textures[i-1] = new BasicTexture(c.defaultPath + "How/Media/Girl/Move" + i + ".png"); player = new AnimatedQuad(textures, playerPosition, 1.0f, textures[0].Width() / textures[0].Height()); w.Add(player); w.Add(new Quad(new BasicTexture(c.defaultPath + "Texture/Foilage/Vine with alpha.png"), new Vector3f(-100, 0.65f, 5.001f), 10.0f, 20.0f, 1.0f)); w.Add(new BillboardedQuad(new BasicTexture(c.defaultPath + "Texture/Particle/crosshairs.png"), w.getActiveCamera(), crosshairPosition, new Vector2f(1.0f, 1.0f))); }