Icarus Source Code

This page lists some tutorials for the source code of Icarus 1.3.0.0.

## Access

The editor needs to have a copy of gamemaker studio, an account and a gmz file of the icarus 1.3.0.0 source code. Then, they press the make button and import the gmz file.

## Change number of planets

Under line 34 of scr\_system\_generate under the scripts folder, there are cases for each planet. They can copy and paste another case, but to add a planet, they have to go under the objects folder, into obj\_controller, create and then into line 45 of that. That line tells how many planets are created. Editing that changes the amount of planets. Under there the editor can easily find and change the names of the planets and the Pops of the planets.

## Change the sun's size and stuff

Under the objects folder, under obj\_draw, and create, line 1 indicates the sun's starting size. Under draw of obj\_draw, the rate of the sun's expansion is determined.

## Change costs of decisions

Under objects, either go to the step of obj\_moon, or that of obj\_planet. There, the times and costs of decisions can be found

## Add Sounds

Under the objects folder, object\_audio determines which files are played. Under the sounds folder are the sounds which can be replaced

## Show freezing temperatures line

under obj\_draw\_draw, add

```
add draw_set_color(BLUE)

```

draw\_circle(room\_width/2,room\_height/2,novaSize \* 8 \* global.zoom,1)

## Record distances and planet size

Distances are set at:
if(i=0)

```
   {
       p=instance_create(room_width/2,room_height/2+56,obj_planet)
    }
   else if(i <= 2)
   {

```

// p=instance\_create(room\_width/2,round(room\_height/2+26\*i+random(2\*i\*i\*i)/4+i\*i\*i/2+80),obj\_planet)

```
       p=instance_create(room_width/2,round(room_height/2+26*i+(2*i*i*i)/4+i*i*i/2+80),obj_planet)
   }
   else
   {
       p=instance_create(room_width/2,round(room_height/2+26*i+(2*i*i*i)/4+i*i*i/2+150),obj_planet)
   }

```

Removing the else if part results in a generation like that of 1.0.6.1.

at scr\_system\_generate, add this somewhere after the world generation code

```
   with(p)
       {
       if (i=0)
       {
       oRadius=(56)
       }
       else if (i<=2)
       {
       oRadius=(26*i+random(2*i*i*i)/4+i*i*i/2+80)
       }
       else
       {
       oRadius=(26*i+random(2*i*i*i)/4+i*i*i/2+150)
       }
       pDist=oRadius
   }

```

at obj\_planet\_draw\_gui, add this with the others:

```
   i++
   draw_text_shadow(72,133 + (16 * i) ,"Planet size:  ",WHITE,c_black)
   draw_text_shadow(72 + string_width("Planet size: "),133 + (16 * i) ,string(ceil(pSize*10)/10),merge_colour(RED,GREEN,pSize / 100),c_black)
   i++
   draw_text_shadow(72,133 + (16 * i) ,"Planet distance:  ",WHITE,c_black)
   draw_text_shadow(72 + string_width("Planet distance: "),133 + (16 * i) ,string(ceil(pDist)),merge_colour(RED,GREEN,pSize / 100),c_black)

```

## Add Lunar Colonisation

for scr\_system\_generate, add this somewhere:

```
   with(p)
   {
      pCol=0
   }

```

Add a modification of this code under obj\_planet\_step, under the b6 place,
with(b10)

```
       {
           bId = 10
           image_index=1
           bParent=other.id
           bPlanetParent=other.id
           bString="Lunar Colonisation"
           xOffset = x - (view_xview[0] + view_wview[0]/2)
           yOffset = y - (view_yview[0] + view_hview[0]/2)
           bMetalRequired = 100
           bTimeRequired = 4
           bToolTip = "Colonises the next closest moon for mining purposes"
       }

```

Add this under obj\_planet\_draw

```
           case 10:
           bBuilding = "Lunar col"
           break;

```

Add this under case 6 of obj\_planet\_alarm\_1:

```
           case 10:
               pCol++
           break;

```

Replace line 93 of obj\_moon\_step with this:

```
   if(collision_circle(x,y,pSize * 5 * global.zoom,obj_mouse,0,0) && mParent.pPop>0 && mParent.pCol>=myID && global.bOver=false && mParent.mOver = false)

```

Replace line 24 of obj\_moon\_draw with this:

```
       if(mParent.pPop>0 && mParent.pCol>=myID)

```

Add this with the others in obj\_planet\_step

```
       b10 = instance_create(view_xview[0]+view_wview[0]/2+660-32,view_yview[0]+view_hview[0]/2-9-64,obj_button)

```

Add this with the other bId if statements in obj\_button\_step and obj\_button\_bak\_step

```
       if(bId=10)
   {
       if(bParent.pCol>=ceil(bParent.pSize/2+1))
       {
           canBuild=false
       }
   }

```

Now, if this is correct, lunar colonisation should be effective.

## Remove the intro

from obj\_messages\_draw, at the beginning of line 1 add /\* and before the else statement of line 65/66, add \*/. At the end of line 27 add /\*.

replace the else with if(showLogo=false)