[FUN] Random ships of the Ooniverse in menu screen
Posted: Thu Mar 16, 2017 4:07 pm
I know that the spinning Cobra appears to be some kind of trademark of the Elite/Oolite project and name. But maybe, for some of you, this is a little bit boring, so I decided to shape things up a little, by adding a list of the default ships to the start routine, and have it pick one, then spin that on the screen.
I changed the justCobra switch in the setupIntroFirstGo: method of src/Core/Universe.m into this bit:
Recompiled... aaaaaand:
Enjoy
I changed the justCobra switch in the setupIntroFirstGo: method of src/Core/Universe.m into this bit:
Code: Select all
if (justCobra)
{
// Lets get an array of all possible ships and entities, then show one
// at random.
NSMutableArray *ships = [[NSMutableArray alloc] init];
[ships addObject: PLAYER_SHIP_DESC];
[ships addObject: @"adder"];
[ships addObject: @"anaconda"];
[ships addObject: @"asp"];
[ships addObject: @"boa"];
[ships addObject: @"boa-mk2"];
[ships addObject: @"cobra-mk1"];
[ships addObject: @"constrictor"];
[ships addObject: @"coriolis-station"];
[ships addObject: @"dodecahedron-station"];
[ships addObject: @"ferdelance"];
[ships addObject: @"gecko"];
[ships addObject: @"icosahedron-station"];
[ships addObject: @"krait"];
[ships addObject: @"mamba"];
[ships addObject: @"moray"];
[ships addObject: @"python"];
[ships addObject: @"rock-hermit"];
[ships addObject: @"tharglet"];
[ships addObject: @"thargoid"];
[ships addObject: @"transporter"];
[ships addObject: @"viper"];
[ships addObject: @"viper-interceptor"];
[ships addObject: @"worm"];
srand(time(NULL));
int r = rand() % 22;
/*- cobra - intro1 -*/
//ship = [self newShipWithName:PLAYER_SHIP_DESC usePlayerProxy:YES];
ship = [self newShipWithName:[ships objectAtIndex: r] usePlayerProxy:YES];
}
Recompiled... aaaaaand:
Enjoy