Initial commit
This commit is contained in:
commit
a2164dca72
20 changed files with 294 additions and 0 deletions
4
.editorconfig
Normal file
4
.editorconfig
Normal file
|
@ -0,0 +1,4 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Normalize EOL for all files that Git considers text files.
|
||||
* text=auto eol=lf
|
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Godot 4+ specific ignores
|
||||
.godot/
|
||||
/android/
|
32
generic/platform.tres
Normal file
32
generic/platform.tres
Normal file
|
@ -0,0 +1,32 @@
|
|||
[gd_resource type="TileSet" load_steps=3 format=3 uid="uid://bv75bu0af04vs"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://5a173ko7iowk" path="res://sprites/atlasses/Lorpeka.png" id="1_eak7k"]
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_vxqge"]
|
||||
texture = ExtResource("1_eak7k")
|
||||
0:0/0 = 0
|
||||
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
1:0/0 = 0
|
||||
0:1/0 = 0
|
||||
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
1:1/0 = 0
|
||||
0:2/0 = 0
|
||||
1:2/0 = 0
|
||||
2:2/0 = 0
|
||||
2:1/0 = 0
|
||||
2:0/0 = 0
|
||||
3:0/0 = 0
|
||||
3:1/0 = 0
|
||||
3:2/0 = 0
|
||||
4:1/0 = 0
|
||||
4:2/0 = 0
|
||||
5:2/0 = 0
|
||||
5:1/0 = 0
|
||||
4:0/0 = 0
|
||||
5:0/0 = 0
|
||||
6:0/0 = 0
|
||||
6:1/0 = 0
|
||||
|
||||
[resource]
|
||||
physics_layer_0/collision_layer = 1
|
||||
sources/0 = SubResource("TileSetAtlasSource_vxqge")
|
1
icon.svg
Normal file
1
icon.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
|
After Width: | Height: | Size: 995 B |
43
icon.svg.import
Normal file
43
icon.svg.import
Normal file
|
@ -0,0 +1,43 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ugbe4qcmgfw0"
|
||||
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.svg"
|
||||
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
1
node_2d.gd
Normal file
1
node_2d.gd
Normal file
|
@ -0,0 +1 @@
|
|||
extends Node2D
|
1
node_2d.gd.uid
Normal file
1
node_2d.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://6q6yvdigdloo
|
32
project.godot
Normal file
32
project.godot
Normal file
|
@ -0,0 +1,32 @@
|
|||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=5
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Delurbelako"
|
||||
run/main_scene="uid://u7thalwj5742"
|
||||
config/features=PackedStringArray("4.5", "GL Compatibility")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=512
|
||||
window/size/viewport_height=288
|
||||
window/stretch/mode="canvas_items"
|
||||
|
||||
[layer_names]
|
||||
|
||||
2d_physics/layer_1="Platform"
|
||||
|
||||
[rendering]
|
||||
|
||||
textures/canvas_textures/default_texture_filter=0
|
||||
renderer/rendering_method="gl_compatibility"
|
||||
renderer/rendering_method.mobile="gl_compatibility"
|
10
scenes/2d_world.tscn
Normal file
10
scenes/2d_world.tscn
Normal file
|
@ -0,0 +1,10 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://u7thalwj5742"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://b7du4vul4bmpq" path="res://scenes/player_platform.tscn" id="1_4ia00"]
|
||||
|
||||
[node name="2D World" type="Node2D"]
|
||||
|
||||
[node name="PlayerPlatform" parent="." instance=ExtResource("1_4ia00")]
|
||||
position = Vector2(17, 17)
|
||||
use_kinematic_bodies = true
|
||||
navigation_enabled = false
|
13
scenes/mounted_gun.tscn
Normal file
13
scenes/mounted_gun.tscn
Normal file
|
@ -0,0 +1,13 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://buklkcwb0k2rc"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://416h8gs1f7x0" path="res://sprites/atlasses/Popekko.png" id="1_ligff"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qfuiw"]
|
||||
atlas = ExtResource("1_ligff")
|
||||
region = Rect2(0, 0, 5, 5)
|
||||
|
||||
[node name="MountedGun" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
position = Vector2(-2.5, 2.5)
|
||||
texture = SubResource("AtlasTexture_qfuiw")
|
12
scenes/player_platform.tscn
Normal file
12
scenes/player_platform.tscn
Normal file
|
@ -0,0 +1,12 @@
|
|||
[gd_scene load_steps=3 format=4 uid="uid://b7du4vul4bmpq"]
|
||||
|
||||
[ext_resource type="TileSet" uid="uid://bv75bu0af04vs" path="res://generic/platform.tres" id="1_khkq2"]
|
||||
[ext_resource type="Script" uid="uid://lw1ya3iu14uf" path="res://scripts/build_zone.gd" id="2_wpmwa"]
|
||||
|
||||
[node name="PlayerPlatform" type="TileMapLayer"]
|
||||
tile_map_data = PackedByteArray("AAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAACAAAAAAAAAAAAAAADAAA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AAAIAAAACAP//AAAAAAIAAAADAP//AAAAAAIAAAAEAP//AAAAAAIAAAAFAP//AAAAAAIAAAAGAP//AAAAAAIAAAAHAP//AAAAAAIAAAAIAP//AAAAAAIAAAAJAP//AAAAAAIAAAAKAP//AAAAAAIAAAALAP//AAAAAAIAAAAMAP//AAAAAAIAAAD/////AAACAAIAAAANAP//AAADAAIAAAA=")
|
||||
tile_set = ExtResource("1_khkq2")
|
||||
|
||||
[node name="BuildRect" type="Marker2D" parent="."]
|
||||
script = ExtResource("2_wpmwa")
|
||||
building_rect = Rect2(0, 0, 208, 128)
|
57
scripts/build_zone.gd
Normal file
57
scripts/build_zone.gd
Normal file
|
@ -0,0 +1,57 @@
|
|||
@tool
|
||||
@warning_ignore_start("integer_division")
|
||||
|
||||
## Class that helps to manage construction sites
|
||||
extends Marker2D
|
||||
|
||||
class_name BuildZone
|
||||
|
||||
const GRID_SIZE : Vector2 = Vector2(16,16)
|
||||
|
||||
## Rect that used for bounds check and conversions
|
||||
@export var building_rect : Rect2:
|
||||
set(value):
|
||||
building_rect = value
|
||||
if Engine.is_editor_hint():
|
||||
queue_redraw()
|
||||
get:
|
||||
return building_rect
|
||||
|
||||
func _draw() -> void:
|
||||
if Engine.is_editor_hint() and EditorInterface.get_inspector().get_edited_object() == self:
|
||||
draw_rect(building_rect,Color.CYAN,false,1)
|
||||
|
||||
## Returns true if point (local coordinates) in rect, else return false
|
||||
func is_point_in_zone(point : Vector2) -> bool:
|
||||
return building_rect.has_point(point)
|
||||
|
||||
## Returns true if point (global coordinates) in rect, else return false
|
||||
func is_global_point_in_zone(point: Vector2) -> bool:
|
||||
return is_point_in_zone(to_local(point))
|
||||
|
||||
## Returns index of point (local coordinates) to be used in array
|
||||
func indexify_point(point : Vector2) -> int:
|
||||
if is_point_in_zone(point) == false:
|
||||
return -1
|
||||
return int(point.x) / int(GRID_SIZE.x) + int(building_rect.size.x/GRID_SIZE.x)*(int(point.y) / int(GRID_SIZE.y))
|
||||
|
||||
## Returns index of point (global coordinates) to be used in array
|
||||
func indexify_global_point(point : Vector2) -> int:
|
||||
return indexify_point(to_local(point))
|
||||
|
||||
## Inverses indexification of point, returning snapped position
|
||||
func inverse_index(index: int) -> Vector2:
|
||||
return to_global(Vector2(index%int(building_rect.size.x/GRID_SIZE.x)*GRID_SIZE.x,index / int(building_rect.size.x/GRID_SIZE.x) * GRID_SIZE.y))
|
||||
|
||||
## Returns snapped position of point (global coordinates).
|
||||
## Equivalent of [code]
|
||||
## inverse_index(indexify_global_point(point))
|
||||
## [/code]
|
||||
func get_placement_position(point : Vector2) -> Vector2:
|
||||
if is_global_point_in_zone(point) == false:
|
||||
return Vector2.ZERO
|
||||
return to_global((to_local(point) / GRID_SIZE).floor()*GRID_SIZE + GRID_SIZE/2.0)
|
||||
|
||||
## Returns capacity of building zone to be used in the array
|
||||
func get_capacity() -> int:
|
||||
return int(building_rect.size.x/GRID_SIZE.x)*int(building_rect.size.y/GRID_SIZE.y)
|
1
scripts/build_zone.gd.uid
Normal file
1
scripts/build_zone.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://lw1ya3iu14uf
|
1
scripts/player_state.gd
Normal file
1
scripts/player_state.gd
Normal file
|
@ -0,0 +1 @@
|
|||
extends Node
|
1
scripts/player_state.gd.uid
Normal file
1
scripts/player_state.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://b004eslxx7ylv
|
BIN
sprites/atlasses/Lorpeka.png
Normal file
BIN
sprites/atlasses/Lorpeka.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 919 B |
40
sprites/atlasses/Lorpeka.png.import
Normal file
40
sprites/atlasses/Lorpeka.png.import
Normal file
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://5a173ko7iowk"
|
||||
path="res://.godot/imported/Lorpeka.png-f43a0d85fcb09484172c72994d520a0f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/atlasses/Lorpeka.png"
|
||||
dest_files=["res://.godot/imported/Lorpeka.png-f43a0d85fcb09484172c72994d520a0f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
sprites/atlasses/Popekko.png
Normal file
BIN
sprites/atlasses/Popekko.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 823 B |
40
sprites/atlasses/Popekko.png.import
Normal file
40
sprites/atlasses/Popekko.png.import
Normal file
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://416h8gs1f7x0"
|
||||
path="res://.godot/imported/Popekko.png-5c34a5f2a8c85fcf59453310fa6553d9.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/atlasses/Popekko.png"
|
||||
dest_files=["res://.godot/imported/Popekko.png-5c34a5f2a8c85fcf59453310fa6553d9.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue