IntroGenerator.java
001 /*
002  *
003  * Created: Jun  7 2006
004  *
005  * Copyright (C) 1999-2000 Fabien Sanglard
006  
007  * This program is free software; you can redistribute it and/or
008  * modify it under the terms of the GNU General Public License
009  * as published by the Free Software Foundation; either version 2
010  * of the License, or (at your option) any later version.
011  
012  * This program is distributed in the hope that it will be useful,
013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
015  * GNU General Public License for more details.
016  
017  * You should have received a copy of the GNU General Public License
018  * along with this program; if not, write to the Free Software
019  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
020  */
021 
022 package generator;
023 
024 import org.lwjgl.util.vector.Vector2f;
025 
026 import rtype.Prototyp;
027 import rtype.entity.IEntity;
028 import rtype.entity.Planet;
029 import rtype.entity.SpaceTrash;
030 import rtype.entity.Star;
031 
032 public class IntroGenerator extends IGenerator
033 {
034 
035   
036   public IntroGenerator() {
037     super();
038     // TODO Auto-generated constructor stub
039   }
040 
041   private static final float b_s = 7f;
042   
043   public void generateEntities()
044   {
045 
046           Planet planet= new Planet(IEntity.PLANET);
047           planet.spawn(new Vector2f(320,0),new Vector2f(b_s*-1,0),Prototyp.background);
048           
049           SpaceTrash trash = new SpaceTrash(IEntity.SPACE_TRASH_5);
050           trash.rotation = 90;
051           trash.spawn(new Vector2f(-20,100),new Vector2f(b_s*-6,0),Prototyp.frontground);
052 
053           trash = new SpaceTrash(IEntity.SPACE_TRASH_5);        
054           trash.spawn(new Vector2f(100,115),new Vector2f(b_s*-5,0),10f,Prototyp.frontground);
055 
056           trash = new SpaceTrash(IEntity.SPACE_TRASH_3);
057           trash.rotation = 90;
058           trash.spawn(new Vector2f(-20,-100),new Vector2f(b_s*-7.5f,0),2f,Prototyp.frontground);
059 
060           trash = new SpaceTrash(IEntity.SPACE_TRASH_3);
061           trash.spawn(new Vector2f(100,-115),new Vector2f(b_s*-4.5f,0),2f,Prototyp.background);
062 
063           trash = new SpaceTrash(IEntity.SPACE_TRASH_1);
064           trash.spawn(new Vector2f(-200,200),new Vector2f(b_s*-4.5f,0),Prototyp.frontground);
065 
066           
067           trash = new SpaceTrash(IEntity.SPACE_TRASH_4);
068           trash.flipYAxis();
069           trash.spawn(new Vector2f(-100,100),new Vector2f(b_s*-4.5f,0),-4f,Prototyp.background);
070           
071           trash = new SpaceTrash(IEntity.SPACE_TRASH_4);
072           trash.flipYAxis();
073           trash.spawn(new Vector2f(100,115),new Vector2f(b_s*-4.5f,0),3f,Prototyp.frontground);
074           
075           trash = new SpaceTrash(IEntity.SPACE_TRASH_4);
076           trash.flipYAxis();
077           trash.spawn(new Vector2f(50,0),new Vector2f(b_s*-4.5f,0),Prototyp.background);
078           
079           trash = new SpaceTrash(IEntity.SPACE_TRASH_4);
080           trash.flipYAxis();
081           trash.spawn(new Vector2f(-200,-200),new Vector2f(b_s*-4.5f,0),-2f,Prototyp.frontground);
082           
083           trash = new SpaceTrash(IEntity.SPACE_TRASH_4);
084           trash.flipYAxis();
085           trash.rotation = 200;
086           trash.spawn(new Vector2f(300,-250),new Vector2f(b_s*-4.5f,0),2f,Prototyp.background);
087         
088           trash = new SpaceTrash(IEntity.SPACE_TRASH_4);
089           trash.flipYAxis();
090           trash.rotation = 20;
091           trash.spawn(new Vector2f(300,-100),new Vector2f(b_s*-4.5f,0),Prototyp.background);
092         
093           
094           
095         //    /*
096           trash = new SpaceTrash(IEntity.SPACE_TRASH_1);
097           trash.spawn(new Vector2f(5,8),new Vector2f(-70.3f,0),2f,Prototyp.frontground);
098 
099           Star star = new Star(IEntity.STAR_1);
100           star.spawn(new Vector2f(60f,-100),new Vector2f(-34.3f,0),Prototyp.background);
101          
102           
103           star = new Star(IEntity.STAR_2);
104           star.spawn(new Vector2f(60f,-120),new Vector2f(-30.3f,0),Prototyp.frontground);
105           
106           
107           star = new Star(IEntity.STAR_3);
108           star.spawn(new Vector2f(60f,-140),new Vector2f(-25.3f,0),Prototyp.background);
109           
110           
111           star = new Star(IEntity.STAR_4);
112           star.spawn(new Vector2f(360f,-160),new Vector2f(-20.3f,0),Prototyp.frontground);
113           
114           
115           star = new Star(IEntity.STAR_5);
116           star.spawn(new Vector2f(360f,-180),new Vector2f(-15.3f,0),Prototyp.background);
117           
118           
119           star = new Star(IEntity.STAR_6);
120           star.spawn(new Vector2f(360f,-200),new Vector2f(-50.3f,0),Prototyp.frontground);
121           
122           
123           
124           trash = new SpaceTrash(IEntity.SPACE_TRASH_2);
125           trash.spawn(new Vector2f(250,20),new Vector2f(-40.3f,0),Prototyp.background);
126 
127           
128           trash = new SpaceTrash(IEntity.SPACE_TRASH_3);
129           trash.spawn(new Vector2f(350,-100),new Vector2f(-25.3f,0),2,Prototyp.frontground);
130           
131           
132           trash = new SpaceTrash(IEntity.SPACE_TRASH_3);
133           trash.spawn(new Vector2f(300,150),new Vector2f(-27.3f,0),-2,Prototyp.frontground);
134           
135           
136           trash = new SpaceTrash(IEntity.SPACE_TRASH_3);
137           trash.spawn(new Vector2f(420,50),new Vector2f(-30.3f,0),Prototyp.frontground);
138     
139           
140           trash = new SpaceTrash(IEntity.SPACE_TRASH_3);
141           trash.spawn(new Vector2f(380f,-50),new Vector2f(-34.3f,0),Prototyp.frontground);
142           
143           trash = new SpaceTrash(IEntity.SPACE_TRASH_4);
144           trash.spawn(new Vector2f(225,-2),new Vector2f(-60.3f,0),Prototyp.background);
145           //*/
146 
147           setDone();
148     }
149 }