Température #50

Merged
eriwyn merged 2 commits from température into main 3 years ago
  1. 28
      menu/LoadWorld.tscn
  2. 30
      menu/MainMenu.tscn
  3. 40
      menu/NewWorld.tscn
  4. 1
      project.godot
  5. BIN
      theme/fonts/Kenney Blocks.ttf
  6. BIN
      theme/fonts/Kenney Bold.ttf
  7. BIN
      theme/fonts/Kenney Future Narrow.ttf
  8. BIN
      theme/fonts/Kenney Future Square.ttf
  9. BIN
      theme/fonts/Kenney Future.ttf
  10. BIN
      theme/fonts/Kenney High Square.ttf
  11. BIN
      theme/fonts/Kenney High.ttf
  12. BIN
      theme/fonts/Kenney Mini Square Mono.ttf
  13. BIN
      theme/fonts/Kenney Mini Square.ttf
  14. BIN
      theme/fonts/Kenney Mini.ttf
  15. BIN
      theme/fonts/Kenney Pixel Square.ttf
  16. BIN
      theme/fonts/Kenney Pixel.ttf
  17. BIN
      theme/fonts/Kenney Rocket Square.ttf
  18. BIN
      theme/fonts/Kenney Rocket.ttf
  19. BIN
      theme/fonts/Kenney Space.ttf
  20. BIN
      theme/fonts/Kenney Thick.ttf
  21. BIN
      theme/imgs/buttonLong_brown.png
  22. 35
      theme/imgs/buttonLong_brown.png.import
  23. BIN
      theme/imgs/buttonLong_brown_pressed.png
  24. 35
      theme/imgs/buttonLong_brown_pressed.png.import
  25. 114
      theme/theme.tres
  26. 2
      ui/map/map.gd
  27. 8
      utils/terrain/Terrain.gd
  28. 3
      utils/terrain_mesh/TerrainMesh.gd
  29. 11
      utils/world_generation/WorldGeneration.gd
  30. 1
      world/default_env.tres
  31. 6
      world/game.tscn
  32. BIN
      world/materials/colors.png
  33. 3
      world/materials/materials.json

@ -20,33 +20,33 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -240.0
margin_top = -131.5
margin_right = 240.0
margin_bottom = 131.5
margin_left = -375.0
margin_top = -156.0
margin_right = 375.0
margin_bottom = 156.0
[node name="Title" type="Label" parent="VBoxContainer"]
margin_right = 480.0
margin_bottom = 64.0
margin_right = 750.0
margin_bottom = 100.0
text = "Charger un monde"
align = 1
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
margin_top = 68.0
margin_right = 480.0
margin_bottom = 218.0
margin_top = 104.0
margin_right = 750.0
margin_bottom = 254.0
rect_min_size = Vector2( 0, 150 )
[node name="WorldList" type="VBoxContainer" parent="VBoxContainer/ScrollContainer"]
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 222.0
margin_right = 480.0
margin_bottom = 263.0
margin_top = 258.0
margin_right = 750.0
margin_bottom = 312.0
[node name="CancelButton" type="Button" parent="VBoxContainer/HBoxContainer"]
margin_right = 480.0
margin_bottom = 41.0
margin_right = 750.0
margin_bottom = 54.0
size_flags_horizontal = 3
text = "Annuler"

@ -16,35 +16,35 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -158.0
margin_top = -74.5
margin_right = 158.0
margin_bottom = 74.5
margin_left = -159.0
margin_top = -226.0
margin_right = 159.0
margin_bottom = 226.0
[node name="Title" type="Label" parent="VBoxContainer"]
margin_right = 316.0
margin_bottom = 131.0
margin_right = 360.0
margin_bottom = 203.0
text = "Societer
"
align = 1
[node name="NewButton" type="Button" parent="VBoxContainer"]
margin_top = 135.0
margin_right = 316.0
margin_bottom = 176.0
margin_top = 207.0
margin_right = 360.0
margin_bottom = 261.0
theme = SubResource( 1 )
text = "Nouveau monde"
[node name="LoadButton" type="Button" parent="VBoxContainer"]
margin_top = 180.0
margin_right = 316.0
margin_bottom = 221.0
margin_top = 265.0
margin_right = 360.0
margin_bottom = 319.0
text = "Charger un monde"
[node name="QuitButton" type="Button" parent="VBoxContainer"]
margin_top = 225.0
margin_right = 316.0
margin_bottom = 266.0
margin_top = 323.0
margin_right = 360.0
margin_bottom = 377.0
text = "Quitter"
[node name="Viewport" type="Viewport" parent="."]

@ -20,43 +20,43 @@ anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -195.0
margin_top = -85.0
margin_right = 195.0
margin_bottom = 85.0
margin_left = -320.0
margin_top = -109.5
margin_right = 320.0
margin_bottom = 109.5
[node name="Title" type="Label" parent="VBoxContainer"]
margin_right = 390.0
margin_bottom = 64.0
margin_right = 640.0
margin_bottom = 100.0
text = "Nouveau monde"
align = 1
[node name="Label" type="Label" parent="VBoxContainer"]
margin_top = 68.0
margin_right = 390.0
margin_bottom = 97.0
margin_top = 104.0
margin_right = 640.0
margin_bottom = 133.0
custom_fonts/font = SubResource( 1 )
text = "Nom du monde :"
[node name="LineEdit" type="LineEdit" parent="VBoxContainer"]
margin_top = 101.0
margin_right = 390.0
margin_bottom = 125.0
margin_top = 137.0
margin_right = 640.0
margin_bottom = 161.0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 129.0
margin_right = 390.0
margin_bottom = 170.0
margin_top = 165.0
margin_right = 640.0
margin_bottom = 219.0
[node name="CreateButton" type="Button" parent="VBoxContainer/HBoxContainer"]
margin_right = 247.0
margin_bottom = 41.0
margin_right = 156.0
margin_bottom = 54.0
text = "Nouveau monde"
[node name="CancelButton" type="Button" parent="VBoxContainer/HBoxContainer"]
margin_left = 251.0
margin_right = 390.0
margin_bottom = 41.0
margin_left = 160.0
margin_right = 640.0
margin_bottom = 54.0
size_flags_horizontal = 3
text = "Annuler"

@ -97,4 +97,5 @@ common/enable_pause_aware_picking=true
[rendering]
2d/options/ninepatch_mode=0
environment/default_environment="res://world/default_env.tres"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/buttonLong_brown.png-5be1a5944a1232da168d403ed320e33e.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://theme/imgs/buttonLong_brown.png"
dest_files=[ "res://.import/buttonLong_brown.png-5be1a5944a1232da168d403ed320e33e.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/buttonLong_brown_pressed.png-7d31ee21a8928f9212d666cf81b88bac.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://theme/imgs/buttonLong_brown_pressed.png"
dest_files=[ "res://.import/buttonLong_brown_pressed.png-7d31ee21a8928f9212d666cf81b88bac.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

@ -1,82 +1,56 @@
[gd_resource type="Theme" load_steps=21 format=2]
[gd_resource type="Theme" load_steps=11 format=2]
[ext_resource path="res://theme/fonts/monogram.ttf" type="DynamicFontData" id=1]
[ext_resource path="res://theme/imgs/buttonLong_brown_pressed.png" type="Texture" id=2]
[ext_resource path="res://theme/fonts/Kenney Mini Square.ttf" type="DynamicFontData" id=3]
[ext_resource path="res://theme/imgs/buttonLong_brown.png" type="Texture" id=4]
[sub_resource type="DynamicFontData" id=1]
font_path = "res://theme/fonts/monogram.ttf"
[sub_resource type="DynamicFont" id=2]
size = 50
font_data = SubResource( 1 )
[sub_resource type="Gradient" id=12]
interpolation_mode = 1
colors = PoolColorArray( 0.596078, 0.596078, 0.596078, 1, 1, 1, 1, 1 )
[sub_resource type="GradientTexture" id=13]
gradient = SubResource( 12 )
[sub_resource type="GradientTexture" id=14]
[sub_resource type="DynamicFont" id=16]
font_data = ExtResource( 3 )
[sub_resource type="StyleBoxTexture" id=15]
texture = SubResource( 14 )
normal_map = SubResource( 13 )
region_rect = Rect2( 0, 0, 2048, 1 )
[sub_resource type="Gradient" id=16]
interpolation_mode = 1
colors = PoolColorArray( 0.47451, 0.47451, 0.47451, 1, 1, 1, 1, 1 )
[sub_resource type="GradientTexture" id=17]
gradient = SubResource( 16 )
[sub_resource type="StyleBoxTexture" id=18]
texture = SubResource( 17 )
region_rect = Rect2( 0, 0, 2048, 1 )
[sub_resource type="Gradient" id=19]
interpolation_mode = 1
colors = PoolColorArray( 0.266667, 0.266667, 0.266667, 1, 1, 1, 1, 1 )
[sub_resource type="GradientTexture" id=20]
gradient = SubResource( 19 )
[sub_resource type="StyleBoxTexture" id=21]
texture = SubResource( 20 )
region_rect = Rect2( 0, 0, 2048, 1 )
[sub_resource type="Gradient" id=6]
interpolation_mode = 1
colors = PoolColorArray( 0.47451, 0.47451, 0.47451, 1, 1, 1, 1, 1 )
[sub_resource type="GradientTexture" id=7]
gradient = SubResource( 6 )
[sub_resource type="StyleBoxTexture" id=5]
texture = SubResource( 7 )
region_rect = Rect2( 0, 0, 2048, 1 )
[sub_resource type="Gradient" id=9]
interpolation_mode = 1
colors = PoolColorArray( 0.239216, 0.239216, 0.239216, 1, 1, 1, 1, 1 )
[sub_resource type="GradientTexture" id=10]
gradient = SubResource( 9 )
[sub_resource type="StyleBoxTexture" id=11]
texture = SubResource( 10 )
region_rect = Rect2( 0, 0, 2048, 1 )
[sub_resource type="StyleBoxTexture" id=12]
texture = ExtResource( 4 )
region_rect = Rect2( 0, 0, 380, 98 )
margin_left = 14.0
margin_right = 14.0
margin_top = 14.0
margin_bottom = 20.0
axis_stretch_horizontal = 1
axis_stretch_vertical = 1
[sub_resource type="StyleBoxTexture" id=13]
texture = ExtResource( 4 )
region_rect = Rect2( 0, 0, 380, 98 )
margin_left = 14.0
margin_right = 14.0
margin_top = 14.0
margin_bottom = 20.0
axis_stretch_horizontal = 1
axis_stretch_vertical = 1
[sub_resource type="StyleBoxTexture" id=14]
texture = ExtResource( 2 )
region_rect = Rect2( 0, 0, 380, 98 )
margin_left = 14.0
margin_right = 14.0
margin_top = 26.0
margin_bottom = 14.0
axis_stretch_horizontal = 1
axis_stretch_vertical = 1
[sub_resource type="DynamicFont" id=11]
[sub_resource type="DynamicFont" id=8]
size = 80
font_data = ExtResource( 1 )
font_data = ExtResource( 3 )
[resource]
Button/colors/font_color_hover = Color( 0.854902, 0.439216, 0.439216, 1 )
Button/fonts/font = SubResource( 2 )
Button/styles/disabled = SubResource( 15 )
Button/styles/focus = SubResource( 18 )
Button/styles/hover = SubResource( 21 )
Button/styles/normal = SubResource( 5 )
Button/styles/pressed = SubResource( 11 )
Button/fonts/font = SubResource( 16 )
Button/styles/focus = SubResource( 15 )
Button/styles/hover = SubResource( 12 )
Button/styles/normal = SubResource( 13 )
Button/styles/pressed = SubResource( 14 )
Fonts/fonts/normal = SubResource( 11 )
Label/fonts/font = SubResource( 8 )

@ -19,6 +19,8 @@ func heightmap():
if center.get_data("ocean"):
# var factor = pow((center.get_elevation()+1.001), 10) / 5.0
color = Color("#5e4fa2")
if center.get_data("snow"):
color = Color.white
# if center.get_data("coast"):
# color = Color.black
if center.polygon().size() > 2:

@ -975,3 +975,11 @@ func get_chunk(vect):
# print(idx)
centers.append(get_center(idx))
return centers
func get_parameters():
return {
"name": _name,
"width": _width,
"height": _height,
"spacing": _spacing
}

@ -19,6 +19,9 @@ func create_mesh():
var material_id = Global.materials[center.get_data("material")]
var top_uv = Vector2(0, float(material_id) / (Global.materials.size()-1))
var border_uv = Vector2(1, float(material_id) / (Global.materials.size()-1))
if center.get_data("snow"):
top_uv.y = float(Global.materials["snow"]) / (Global.materials.size()-1)
var corner_number = center.corner_count()
for corner_count in corner_number:
var current_corner = center.corner(corner_count)

@ -47,6 +47,9 @@ func init_data():
Global.loadings["world_creation"].new_phase("Generation des continents...", Global.terrain.get_centers().size())
for center in Global.terrain.get_centers():
center.set_elevation(find_elevation(center.point2d()))
center.set_data("temperature", find_temperature(center))
if center.get_data("temperature") > 0.5:
center.set_data("snow", true)
if center.get_elevation() <= 0.0:
center.set_data("water", true)
if center.get_elevation() >= mountain_height:
@ -238,6 +241,14 @@ func find_elevation(point):
elevation = (elevation * terraces) / terraces
return elevation
func find_temperature(center):
var poles = 4
var equator = -4
var elevation = center.get_elevation()
var latitude = sin(PI * (float(center.point2d().y) / float(Global.terrain.get_parameters()["height"])))
var temperature = 40*elevation*elevation + poles + (equator-poles) * latitude
return temperature
func fill_oceans():
var stack = []

@ -1,6 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
sky_top_color = Color( 0.776471, 0.854902, 0.898039, 1 )
[resource]
background_mode = 2

@ -1,7 +1,8 @@
[gd_scene load_steps=14 format=2]
[gd_scene load_steps=15 format=2]
[ext_resource path="res://ui/ui.tscn" type="PackedScene" id=1]
[ext_resource path="res://world/materials/outline.tres" type="Shader" id=2]
[ext_resource path="res://world/default_env.tres" type="Environment" id=3]
[ext_resource path="res://world/World3d.gd" type="Script" id=4]
[ext_resource path="res://utils/camera/CamBase.tscn" type="PackedScene" id=5]
@ -179,6 +180,7 @@ mesh = SubResource( 1 )
material/0 = SubResource( 3 )
[node name="WorldEnvironment" type="WorldEnvironment" parent="World3d"]
environment = ExtResource( 3 )
[node name="CamBase" parent="World3d" instance=ExtResource( 5 )]
@ -191,7 +193,7 @@ height = 5.0
[node name="DirectionalLight" type="DirectionalLight" parent="World3d"]
transform = Transform( 0.971628, 0.168947, -0.16552, 0, 0.699825, 0.714314, 0.236516, -0.694047, 0.67997, 0, 1.41623, 14.8745 )
light_energy = 0.1
light_energy = 0.2
shadow_enabled = true
[node name="Outline" type="MeshInstance" parent="World3d"]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

After

Width:  |  Height:  |  Size: 4.7 KiB

@ -1,5 +1,6 @@
{
"grass": 0,
"stone": 1,
"sand": 2
"sand": 2,
"snow": 3
}

Loading…
Cancel
Save