Changeset 29
- Timestamp:
- 12/13/07 05:22:07 (1 year ago)
- Files:
-
- trunk/guisterax/src/bonus_levels.d (added)
- trunk/guisterax/src/game.d (modified) (2 diffs)
- trunk/guisterax/src/mine.d (modified) (1 diff)
- trunk/guisterax/src/ship.d (modified) (2 diffs)
- trunk/guisterax/src/universe.d (modified) (1 diff)
- trunk/guisterax/src/wave.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/guisterax/src/game.d
r23 r29 32 32 import wave; 33 33 import surface; 34 import bonus_levels; 34 35 import derelict.sdl.sdl; 35 36 static import menu; … … 151 152 152 153 void play() { 153 m_ship = new Ship( Vect(10,0));154 m_ship = new Ship(); 154 155 uint level = 1; 155 156 while(true) { 157 // auto bonus_level = new MinesLevel(); 158 // run(bonus_level); 159 156 160 shop(); 157 161 wave(level); trunk/guisterax/src/mine.d
r28 r29 24 24 25 25 26 import element;26 public import element; 27 27 import universe; 28 28 import vect; trunk/guisterax/src/ship.d
r24 r29 24 24 25 25 26 import element;26 public import element; 27 27 import vect; 28 28 import sprite; … … 70 70 } 71 71 72 this(in Vect pos ) {72 this(in Vect pos = Vect()) { 73 73 m_normal_sprite = new Sprite(m_normal_surfs); 74 74 m_power_sprite = new Sprite(m_power_surfs); trunk/guisterax/src/universe.d
r23 r29 152 152 } 153 153 } 154 155 /** 156 Return a random position at the universe border 157 */ 158 Vect border_pos() { 159 float y = rand(-height/2, height/2); 160 switch(randint(0, 4)) { 161 case 0: return Vect(-width/2, rand(-height/2, height/2)); 162 case 1: return Vect(width/2, rand(-height/2, height/2)); 163 case 2: return Vect(rand(-width/2, width/2), -height/2); 164 case 3: return Vect(rand(-width/2, width/2), height/2); 165 } 166 } 154 167 155 168 }; trunk/guisterax/src/wave.d
r28 r29 145 145 } 146 146 147 Vect border_pos() {148 float y = rand(-height/2, height/2);149 switch(randint(0, 4)) {150 case 0: return Vect(-width/2, rand(-height/2, height/2));151 case 1: return Vect(width/2, rand(-height/2, height/2));152 case 2: return Vect(rand(-width/2, width/2), -height/2);153 case 3: return Vect(rand(-width/2, width/2), height/2);154 }155 }156 157 147 void add_hole() { 158 148 if (danger() >= max_danger) return;
