Team Updates

WE DID IT! 3rd place and very proud of it
WE DID IT! 3rd place and very proud of it
C
Camilo Villegas
We're on the endgame
We're on the endgame
C
Camilo Villegas
You are a star!
You are a star!
C
Camilo Villegas
Who's hiding there?
Who's hiding there?
C
Camilo Villegas
Boys n' the Code
Boys n' the Code
C
Camilo Villegas
extendsControl
varmessages= ["Hello curious one!\nIt seems that is your first time creating a planetary system,\n\n let me guide you through this adventure...",
"Every planetary system needs a star,\na unique and luminous sphere held by its own gravity.\n\nWhat is the name of your star?",
"Good, that’s a stellar name!\nYour star has mass, it refers to the amount of atoms in it, more mass, more atoms, less mass, less atoms.\n\nWhat is the mass of [Star-Name]?",
"Good, it’s all coming together!\nIs your star a warm or a cold place? Temperature is a body's ability to impart energy as heat to another body.\n\nWhat is the temperature of [Star-Name]?",
"Great, what a special climate!\nNow, is your star bright or dark? Luminosity is the measure of light of your star.\n\nWhat is the luminosity of [Star-Name]?",
"Amazing, light for the universe!\nFor the finishing touches… is your star small or big? Radius is distance from the center to the edge of your star.\n\nWhat is the radius of [Star-Name]?",
"Perfect!\n\nAll your data has been taken, space monkeys are working!\n\n[Star-Name] is now generating..."]
varDELAY=1
varREAD_TIME=2
vart=0
varindex=0
varmode=""
vardata_stars
varGENERAL_DATA
onreadyvarNAME_STAR_DB= $slider/name_star
onreadyvarVALUE= $slider/value
onreadyvarMIN= $slider/HBoxContainer/min_value
onreadyvarMAX= $slider/HBoxContainer/max_value
onreadyvardisplayText= $text/DisplayText
onreadyvarinput= $text_input/input
onreadyvarslider= $slider/slider
onreadyvarenter= $enter
exportvarready=false
exportvarstar_data= {
"name": "Alpha Centauri",
"mass": "2400 Sun masses",
"temperature": "1200 degrees",
"luminosity": "3..",
"radius": "120000",
"type": "Dwarf"
}
func_ready():
mode="in"
VALUE.visible=false
MIN.visible=false
MAX.visible=false
input.visible=false
slider.visible=false
$slider.visible=false
enter.visible=false
$HTTPRequest.request("http://144.202.115.196/nasaspaceapp/data_type_stars.json")
$HTTPRequest2.request("http://144.202.115.196/nasaspaceapp/data_stars.json")
set_text()
func_process(delta):
fadein(delta)
ifInput.is_action_just_pressed("ui_accept"):
print("enter")
is_action_enter()
ifmode=="read":
ifindex!=0:
return
t+=delta
ift>READ_TIME:
t=0
mode="out"
index+=1
set_color(1)
funcis_action_enter():
ifindex==1:
vars=input.text
iflen(s) !=0:
star_data["name"] =s
index+=1
set_text()
mode="in"
t=0
$hit.play()
elifindex==2:
varval=slider.value
star_data["mass"] =str(val)
index+=1
star_data["type"] =get_star(int(star_data["mass"]))
mode="in"
t=0
#create temperature
print("masa : "+String(val))
vard=get_data_general(val)
print(d)
slider.min_value=d.temperature[0]
slider.max_value=d.temperature[1] ifd.temperature[1] !=nullelsed.temperature[0] *2
slider.value=d.temperature[0] + ((d.temperature[1] -d.temperature[0]) /2) ifd.temperature[1] !=nullelsed.temperature[0] + (((d.temperature[0] *2) -d.temperature[0]) /2)
MIN.text=String(slider.min_value) +" Kv"
MAX.text=String(slider.max_value) +" Kv"
val=0
set_text()
$hit.play()
elifindex==3:
# se deben crear nuevos valores minimos y maximos basandonos en los
# datos de la tabla general
varval=slider.value
star_data["temperature"] =str(val)
index+=1
#create temperature
vard=get_data_general(int(star_data["mass"]))
print(d)
slider.min_value=d.luminosity[0]
slider.max_value=d.luminosity[1] ifd.luminosity[1] !=nullelsed.luminosity[0] *2
MIN.text=String(slider.min_value) +" Lo"
MAX.text=String(slider.max_value) +" Lo"
slider.value=d.luminosity[0] + ((d.luminosity[1] -d.luminosity[0]) /2) ifd.luminosity[1] !=nullelsed.luminosity[0] + (((d.luminosity[0] *2) -d.luminosity[0]) /2)
set_text()
t=0
mode="in"
$hit.play()
elifindex==4:
varval=slider.value
star_data["luminosity"] =str(val)
index+=1
#create temperature
vard=get_data_general(int(star_data["mass"]))
print(d)
slider.min_value=d.radius[0]
slider.max_value=d.radius[1] ifd.radius[1] !=nullelsed.radius[0] *2
MIN.text=String(slider.min_value) +" Rs"
MAX.text=String(slider.max_value) +" Rs"
slider.value=d.radius[0] + ((d.radius[1] -d.radius[0]) /2) ifd.radius[1] !=nullelsed.radius[0] + (((d.radius[0] *2) -d.radius[0]) /2)
set_text()
mode="in"
t=0
$hit.play()
elifindex==5:
varval=slider.value
star_data["radius"] =str(val)
index+=1
$slider/HBoxContainer.visible=false
VALUE.visible=false
set_text()
mode="in"
t=0
$hit.play()
elifindex==6:
$hit.play()
ready=true
funcfadein(delta):
ifmode=="in":
set_color(t/DELAY)
t+=delta
ift>DELAY:
t=0
mode="read"
ifmode=="out":
set_color(1- (t/DELAY))
t+=delta
ift>DELAY:
t=0
mode="in"
set_text()
funcset_text():
index=clamp(index, 0, len(messages) -1)
print(index)
ifindex==0orindex==1:
displayText.text=messages[index]
ifindex==2:
NAME_STAR_DB.text=star_data["name"]+" is "+get_star(slider.max_value/2)
ifindex==1:
input.visible=true
ifindex>1:
displayText.text=messages[index].replace("[Star-Name]", star_data["name"])
input.visible=false
ifindex>2:
NAME_STAR_DB.visible=false
ifindex>0:
enter.visible=true
else:
enter.visible=false
ifindex>1andindex<6:
slider.visible=true
VALUE.visible=true
MIN.visible=true
MAX.visible=true
$slider.visible=true
$slider/HBoxContainer.visible=true
else:
slider.visible=false
funcset_color(alpha):
varcolor=displayText.get_color("font_color")
alpha=clamp(alpha, 0, 1)
color.a=alpha
displayText.add_color_override("font_color", color)
funcget_data_general(value):
fordatainGENERAL_DATA:
if (data.min<=valueanddata.max>=value):
returndata.data
return {}
funcget_star(value):
fordataindata_stars:
if(data.masa[0] <=valueanddata.masa[1] >=value):
returndata.name
return"no name"
func_on_HTTPRequest_request_completed(result, response_code, headers, body):
varjson=JSON.parse(body.get_string_from_utf8())
data_stars=json.result
slider.min_value=data_stars[len(data_stars)-1].masa[0]
slider.max_value=data_stars[0].masa[1]
MIN.text=String(slider.min_value) +" Ms"
MAX.text=String(slider.max_value) +" Ms"
slider.value=slider.max_value/2
VALUE.text=String(slider.max_value/2)
func_on_HTTPRequest2_request_completed(result, response_code, headers, body):
varjson=JSON.parse(body.get_string_from_utf8())
GENERAL_DATA=json.result
func_on_slider_value_changed(value):
NAME_STAR_DB.text=star_data["name"]+" is "+get_star(value)
VALUE.text=String(value)
funcdelete():
queue_free()
view raw novel.py hosted with ❤ by GitHub
C
Camilo Villegas
Looong day, time to rest. Cosmic Gnomes, out.
Looong day, time to rest. Cosmic Gnomes, out.
C
Camilo Villegas
Models models models!!!
Models models models!!!
C
Camilo Villegas
[
{
"name": "hipergiants",
"masa": [50, 120]
},
{
"name": "Supergiants",
"masa": [15, 50]
},
{
"name": "giants",
"masa": [5, 15]
},
{
"name": "subgiants",
"masa": [1.5, 5]
},
{
"name": "dwarfs",
"masa": [0.08, 1.5]
},
{
"name": "white dwarfs",
"masa": [0.01, 0.08]
}
]
C
Camilo Villegas
[
{
"min": 16 ,
"max": 120,
"data":{
"radius" : [6.6, null],
"luminosity" : [30000, null],
"temperature" : [33000, null],
"color" : "blue"
}
},
{
"min": 2.1 ,
"max": 16,
"data":{
"radius" : [1.8, 6.6],
"luminosity" : [25, 30000],
"temperature" : [10000, 33000],
"color" : "whiteblue"
}
},
{
"min": 1.4 ,
"max": 2.1,
"data":{
"radius" : [1.4, 1.8],
"luminosity" : [5, 25],
"temperature" : [7500, 10000],
"color" : "white"
}
},
{
"min": 1.04,
"max": 1.4,
"data":{
"radius" : [1.15, 1.4],
"luminosity" : [1.5, 5],
"temperature" : [6000, 7500],
"color" : "whiteyellow"
}
},
{
"min": 0.8,
"max": 1.04,
"data":{
"radius" : [0.96, 1.15],
"luminosity" : [0.6, 1.5],
"temperature" : [5200, 6000],
"color" : "yellow"
}
},
{
"min": 0.45,
"max": 0.8,
"data":{
"radius" : [0.7, 0.96],
"luminosity" : [0.08, 0.6],
"temperature" : [3700, 5200],
"color" : "orange"
}
},
{
"min": 0,
"max": 0.45,
"data":{
"radius" : [0.01, 0.7],
"luminosity" : [0.01, 0.08],
"temperature" : [100, 3700],
"color" : "red"
}
}
]
C
Camilo Villegas
Dinner and back to the game!
Dinner and back to the game!
C
Camilo Villegas

The Universe...

This has been a great experience, our team are natural coders and techies, and with no astronomy background, we've been fascinated about our universe and the endless amount of knowledge within.

The Universe... oh, the universe!

C
Camilo Villegas
Cosmic Gnomes! We are daring big things...
Cosmic Gnomes! We are daring big things...
C
Camilo Villegas
Freshed out! Ready to aim for the stars ;)
Freshed out! Ready to aim for the stars ;)
C
Camilo Villegas