Platform, Sprites and flying debug building
This commit is contained in:
parent
d8da52ca2f
commit
4576cb8972
15 changed files with 153 additions and 9 deletions
BIN
buildings/Building 1x2 fixed.png
Normal file
BIN
buildings/Building 1x2 fixed.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
34
buildings/Building 1x2 fixed.png.import
Normal file
34
buildings/Building 1x2 fixed.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://djir4ehm8kif"
|
||||||
|
path="res://.godot/imported/Building 1x2 fixed.png-e90afc0d25a8919ada570064ed667de1.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://buildings/Building 1x2 fixed.png"
|
||||||
|
dest_files=["res://.godot/imported/Building 1x2 fixed.png-e90afc0d25a8919ada570064ed667de1.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
BIN
buildings/Building 2x1 downside.png
Normal file
BIN
buildings/Building 2x1 downside.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
34
buildings/Building 2x1 downside.png.import
Normal file
34
buildings/Building 2x1 downside.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://3weywjfsapax"
|
||||||
|
path="res://.godot/imported/Building 2x1 downside.png-4b432eb4152bab7dd594f2976783dfd3.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://buildings/Building 2x1 downside.png"
|
||||||
|
dest_files=["res://.godot/imported/Building 2x1 downside.png-4b432eb4152bab7dd594f2976783dfd3.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
BIN
buildings/Building 2x1 fixed.png
Normal file
BIN
buildings/Building 2x1 fixed.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
34
buildings/Building 2x1 fixed.png.import
Normal file
34
buildings/Building 2x1 fixed.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://dfy0gccqgggp2"
|
||||||
|
path="res://.godot/imported/Building 2x1 fixed.png-b02748fa52aebae62f987c8fd86c364f.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://buildings/Building 2x1 fixed.png"
|
||||||
|
dest_files=["res://.godot/imported/Building 2x1 fixed.png-b02748fa52aebae62f987c8fd86c364f.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
class_name Building extends Node2D
|
class_name Building extends Node2D
|
||||||
|
|
||||||
var location : Vector2i # x is the angle, y is the height in the grid
|
@export var location : Vector2i # x is the angle, y is the height in the grid
|
||||||
@export var dimension : Vector2i = Vector2(2, 1) # same as above
|
@export var dimension : Vector2i = Vector2(2, 1) # same as above
|
||||||
@onready var grid : Grid = get_parent()
|
@onready var grid : Grid = get_parent()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ void fragment() {
|
||||||
float angle = atan(world_position.y, world_position.x);
|
float angle = atan(world_position.y, world_position.x);
|
||||||
|
|
||||||
float sample_y = 1. - ((radius - ground_height) / cell_height - float( location.y)) / float(dimension.y);
|
float sample_y = 1. - ((radius - ground_height) / cell_height - float( location.y)) / float(dimension.y);
|
||||||
|
sample_y = 1. - (1. - sample_y) * 0.97;
|
||||||
float sample_x = mod(fract(angle / TAU + 1.) * float(num_cells) - float(location.x) + float(num_cells), float(num_cells)) / float(dimension.x);
|
float sample_x = mod(fract(angle / TAU + 1.) * float(num_cells) - float(location.x) + float(num_cells), float(num_cells)) / float(dimension.x);
|
||||||
|
|
||||||
if(sample_y > 1. || sample_y < 0. || sample_x > 1. || sample_x < 0.) {
|
if(sample_y > 1. || sample_y < 0. || sample_x > 1. || sample_x < 0.) {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
[gd_scene load_steps=7 format=3 uid="uid://djawvtdwp423v"]
|
[gd_scene load_steps=8 format=3 uid="uid://djawvtdwp423v"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_5j34s"]
|
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_5j34s"]
|
||||||
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_xx8ra"]
|
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_xx8ra"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="3_xr4t5"]
|
[ext_resource type="Texture2D" uid="uid://dfy0gccqgggp2" path="res://buildings/Building 2x1 fixed.png" id="3_xr4t5"]
|
||||||
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_xr4t5"]
|
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_xr4t5"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://3weywjfsapax" path="res://buildings/Building 2x1 downside.png" id="5_pfkkr"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dpv1w56yr1xue" path="res://traps/morning_star.tscn" id="5_xr4t5"]
|
[ext_resource type="PackedScene" uid="uid://dpv1w56yr1xue" path="res://traps/morning_star.tscn" id="5_xr4t5"]
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_pfkkr"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_pfkkr"]
|
||||||
|
|
@ -21,6 +22,13 @@ scale = Vector2(25, 25)
|
||||||
texture = ExtResource("3_xr4t5")
|
texture = ExtResource("3_xr4t5")
|
||||||
script = ExtResource("4_xr4t5")
|
script = ExtResource("4_xr4t5")
|
||||||
|
|
||||||
|
[node name="Sprite2D2" type="Sprite2D" parent="."]
|
||||||
|
material = SubResource("ShaderMaterial_pfkkr")
|
||||||
|
scale = Vector2(25, 25)
|
||||||
|
texture = ExtResource("5_pfkkr")
|
||||||
|
script = ExtResource("4_xr4t5")
|
||||||
|
grid_offset = Vector2i(0, -1)
|
||||||
|
|
||||||
[node name="EnemyList" type="Node2D" parent="."]
|
[node name="EnemyList" type="Node2D" parent="."]
|
||||||
|
|
||||||
[node name="MorningStar" parent="EnemyList" instance=ExtResource("5_xr4t5")]
|
[node name="MorningStar" parent="EnemyList" instance=ExtResource("5_xr4t5")]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
extends Sprite2D
|
extends Sprite2D
|
||||||
|
|
||||||
|
@export var grid_offset : Vector2i = Vector2i.ZERO
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
var location = Vector2i(get_parent().location)
|
var location = Vector2i(get_parent().location) + grid_offset
|
||||||
var dimension = Vector2i(get_parent().dimension)
|
var dimension = Vector2i(get_parent().dimension)
|
||||||
self_modulate = 2 * Color8(location.x, location.y, dimension.x, dimension.y)
|
self_modulate = 2 * Color8(location.x, location.y, dimension.x, dimension.y)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_q3nfb"]
|
[ext_resource type="Script" uid="uid://b2ji03ekijjnn" path="res://buildings/building.gd" id="1_q3nfb"]
|
||||||
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_uv7v8"]
|
[ext_resource type="Shader" uid="uid://c7gb1nqwvkr37" path="res://buildings/building.gdshader" id="2_uv7v8"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="3_e6j05"]
|
[ext_resource type="Texture2D" uid="uid://djir4ehm8kif" path="res://buildings/Building 1x2 fixed.png" id="3_uv7v8"]
|
||||||
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_bl5jt"]
|
[ext_resource type="Script" uid="uid://dj7d4d2xs3nci" path="res://buildings/building_mesh.gd" id="4_bl5jt"]
|
||||||
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost.tscn" id="5_23fi7"]
|
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost.tscn" id="5_23fi7"]
|
||||||
|
|
||||||
|
|
@ -21,10 +21,10 @@ dimension = Vector2i(1, 2)
|
||||||
self_modulate = Color(0.176471, 0, 0.00392157, 0.00392157)
|
self_modulate = Color(0.176471, 0, 0.00392157, 0.00392157)
|
||||||
material = SubResource("ShaderMaterial_qnfc1")
|
material = SubResource("ShaderMaterial_qnfc1")
|
||||||
scale = Vector2(25, 25)
|
scale = Vector2(25, 25)
|
||||||
texture = ExtResource("3_e6j05")
|
texture = ExtResource("3_uv7v8")
|
||||||
script = ExtResource("4_bl5jt")
|
script = ExtResource("4_bl5jt")
|
||||||
|
|
||||||
[node name="EnemyList" type="Node2D" parent="."]
|
[node name="EnemyList" type="Node2D" parent="."]
|
||||||
|
|
||||||
[node name="Ghost" parent="EnemyList" instance=ExtResource("5_23fi7")]
|
[node name="Ghost" parent="EnemyList" instance=ExtResource("5_23fi7")]
|
||||||
position = Vector2(115, -74.99999)
|
position = Vector2(115, -75)
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
[gd_scene load_steps=8 format=3 uid="uid://cxo6bq26huau7"]
|
[gd_scene load_steps=9 format=3 uid="uid://cxo6bq26huau7"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://cmaovvr15b3qk" path="res://player/player.tscn" id="2_1bvp3"]
|
[ext_resource type="PackedScene" uid="uid://cmaovvr15b3qk" path="res://player/player.tscn" id="2_1bvp3"]
|
||||||
[ext_resource type="Script" uid="uid://vgxh2xdevat7" path="res://world/earth.gd" id="2_lquwl"]
|
[ext_resource type="Script" uid="uid://vgxh2xdevat7" path="res://world/earth.gd" id="2_lquwl"]
|
||||||
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost.tscn" id="3_h2yge"]
|
[ext_resource type="PackedScene" uid="uid://chu67ci7sl488" path="res://enemies/ghost.tscn" id="3_h2yge"]
|
||||||
[ext_resource type="PackedScene" uid="uid://jjoyj1ldafkf" path="res://world/earth.tscn" id="3_lquwl"]
|
[ext_resource type="PackedScene" uid="uid://jjoyj1ldafkf" path="res://world/earth.tscn" id="3_lquwl"]
|
||||||
[ext_resource type="Script" uid="uid://colvx6wq0e8n7" path="res://world/building_generator.gd" id="4_1bvp3"]
|
[ext_resource type="Script" uid="uid://colvx6wq0e8n7" path="res://world/building_generator.gd" id="4_1bvp3"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://4l3elvxpghw8" path="res://platform.tscn" id="4_5vw27"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cjsrtswk4vgf2" path="res://healthbar/healthbar.tscn" id="6_7mycd"]
|
[ext_resource type="PackedScene" uid="uid://cjsrtswk4vgf2" path="res://healthbar/healthbar.tscn" id="6_7mycd"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dpv1w56yr1xue" path="res://traps/morning_star.tscn" id="7_272bh"]
|
[ext_resource type="PackedScene" uid="uid://dpv1w56yr1xue" path="res://traps/morning_star.tscn" id="7_272bh"]
|
||||||
|
|
||||||
|
|
@ -17,6 +18,9 @@ script = ExtResource("2_lquwl")
|
||||||
[node name="Ghost" parent="." instance=ExtResource("3_h2yge")]
|
[node name="Ghost" parent="." instance=ExtResource("3_h2yge")]
|
||||||
position = Vector2(0, -3200)
|
position = Vector2(0, -3200)
|
||||||
|
|
||||||
|
[node name="Platform" parent="." instance=ExtResource("4_5vw27")]
|
||||||
|
position = Vector2(934, -2965)
|
||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource("2_1bvp3")]
|
[node name="Player" parent="." instance=ExtResource("2_1bvp3")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
position = Vector2(500, -3100)
|
position = Vector2(500, -3100)
|
||||||
|
|
@ -43,6 +47,7 @@ offset_bottom = 128.0
|
||||||
position = Vector2(989, -2939)
|
position = Vector2(989, -2939)
|
||||||
|
|
||||||
[node name="Debug_Camera" type="Camera2D" parent="."]
|
[node name="Debug_Camera" type="Camera2D" parent="."]
|
||||||
|
position = Vector2(0.999969, 0)
|
||||||
scale = Vector2(41.02, 41.02)
|
scale = Vector2(41.02, 41.02)
|
||||||
zoom = Vector2(0.12, 0.12)
|
zoom = Vector2(0.12, 0.12)
|
||||||
|
|
||||||
|
|
|
||||||
22
platform.tscn
Normal file
22
platform.tscn
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
[gd_scene load_steps=4 format=3 uid="uid://4l3elvxpghw8"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cy70quh6k3s1j" path="res://icon.svg" id="1_s8bxr"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://chs0u61f45nau" path="res://utils/earth_aligner.tscn" id="2_c1gtx"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ry5bi"]
|
||||||
|
size = Vector2(56, 6)
|
||||||
|
|
||||||
|
[node name="Platform" type="StaticBody2D"]
|
||||||
|
scale = Vector2(3, 3)
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource("RectangleShape2D_ry5bi")
|
||||||
|
one_way_collision = true
|
||||||
|
one_way_collision_margin = 2.0
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
position = Vector2(-0.5, -1.90735e-06)
|
||||||
|
scale = Vector2(0.429688, 0.046875)
|
||||||
|
texture = ExtResource("1_s8bxr")
|
||||||
|
|
||||||
|
[node name="EarthAligner" parent="." instance=ExtResource("2_c1gtx")]
|
||||||
|
|
@ -41,6 +41,7 @@ animations = [{
|
||||||
[node name="Player" type="CharacterBody2D"]
|
[node name="Player" type="CharacterBody2D"]
|
||||||
z_index = 10
|
z_index = 10
|
||||||
collision_layer = 5
|
collision_layer = 5
|
||||||
|
safe_margin = 1.0
|
||||||
script = ExtResource("1_4flbx")
|
script = ExtResource("1_4flbx")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,13 @@ radius = 3000.0
|
||||||
|
|
||||||
[node name="Grid" type="Node2D" parent="."]
|
[node name="Grid" type="Node2D" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
position = Vector2(1, 0)
|
||||||
script = ExtResource("3_2bhor")
|
script = ExtResource("3_2bhor")
|
||||||
ground_radius = 3000.0
|
ground_radius = 3000.0
|
||||||
cell_height = 300.0
|
cell_height = 300.0
|
||||||
num_collumns = 60
|
num_collumns = 60
|
||||||
debug = true
|
|
||||||
packed_buildings = Array[PackedScene]([ExtResource("3_nihcy"), ExtResource("4_ml5no")])
|
packed_buildings = Array[PackedScene]([ExtResource("3_nihcy"), ExtResource("4_ml5no")])
|
||||||
metadata/_custom_type_script = "uid://m3vyyfk8gnma"
|
metadata/_custom_type_script = "uid://m3vyyfk8gnma"
|
||||||
|
|
||||||
|
[node name="Building" parent="Grid" instance=ExtResource("3_nihcy")]
|
||||||
|
location = Vector2i(45, 1)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue