Browse Source

:tada: Create a working project

- Hexagon tilemap
- Moving player
DricomDragon 2 năm trước cách đây
mục cha
commit
3689b941a1

+ 2 - 0
godot/.gitattributes

@@ -0,0 +1,2 @@
+# Normalize EOL for all files that Git considers text files.
+* text=auto eol=lf

+ 2 - 0
godot/.gitignore

@@ -0,0 +1,2 @@
+# Godot 4+ specific ignores
+.godot/

+ 127 - 0
godot/component/entity/land/land_tile_set.tres

@@ -0,0 +1,127 @@
+[gd_resource type="TileSet" load_steps=4 format=3 uid="uid://c1wnvwl4fiyqa"]
+
+[ext_resource type="Texture2D" uid="uid://bw0b0ornoeb4m" path="res://component/entity/land/tileset_image.png" id="1_lvbaa"]
+
+[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_7xaig"]
+resource_name = "Ground"
+texture = ExtResource("1_lvbaa")
+texture_region_size = Vector2i(65, 89)
+0:0/0 = 0
+0:0/0/texture_offset = Vector2i(0, -10)
+1:0/0 = 0
+1:0/0/texture_offset = Vector2i(0, -10)
+2:0/0 = 0
+2:0/0/texture_offset = Vector2i(0, -10)
+4:0/0 = 0
+4:0/0/texture_offset = Vector2i(0, -10)
+0:1/0 = 0
+0:1/0/texture_offset = Vector2i(0, -10)
+1:1/0 = 0
+1:1/0/texture_offset = Vector2i(0, -10)
+2:1/0 = 0
+2:1/0/texture_offset = Vector2i(0, -10)
+4:1/0 = 0
+4:1/0/texture_offset = Vector2i(0, -10)
+0:2/0 = 0
+0:2/0/texture_offset = Vector2i(0, -10)
+1:2/0 = 0
+1:2/0/texture_offset = Vector2i(0, -10)
+2:2/0 = 0
+2:2/0/texture_offset = Vector2i(0, -10)
+0:3/0 = 0
+0:3/0/texture_offset = Vector2i(0, -10)
+1:3/0 = 0
+1:3/0/texture_offset = Vector2i(0, -10)
+2:3/0 = 0
+2:3/0/texture_offset = Vector2i(0, -10)
+0:4/0 = 0
+0:4/0/texture_offset = Vector2i(0, -10)
+1:4/0 = 0
+1:4/0/texture_offset = Vector2i(0, -10)
+2:4/0 = 0
+2:4/0/texture_offset = Vector2i(0, -10)
+
+[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_0cmhd"]
+resource_name = "Rock"
+texture = ExtResource("1_lvbaa")
+margins = Vector2i(0, 61)
+texture_region_size = Vector2i(56, 64)
+0:0/0 = 0
+1:0/0 = 0
+2:0/0 = 0
+3:0/0 = 0
+4:0/0 = 0
+5:0/0 = 0
+6:0/0 = 0
+7:0/0 = 0
+8:0/0 = 0
+0:1/0 = 0
+1:1/0 = 0
+2:1/0 = 0
+3:1/0 = 0
+4:1/0 = 0
+5:1/0 = 0
+6:1/0 = 0
+7:1/0 = 0
+8:1/0 = 0
+0:2/0 = 0
+1:2/0 = 0
+2:2/0 = 0
+3:2/0 = 0
+4:2/0 = 0
+5:2/0 = 0
+6:2/0 = 0
+7:2/0 = 0
+8:2/0 = 0
+0:3/0 = 0
+1:3/0 = 0
+2:3/0 = 0
+3:3/0 = 0
+4:3/0 = 0
+6:3/0 = 0
+7:3/0 = 0
+8:3/0 = 0
+0:4/0 = 0
+1:4/0 = 0
+2:4/0 = 0
+3:4/0 = 0
+6:4/0 = 0
+7:4/0 = 0
+8:4/0 = 0
+0:5/0 = 0
+1:5/0 = 0
+2:5/0 = 0
+3:5/0 = 0
+4:5/0 = 0
+5:5/0 = 0
+6:5/0 = 0
+7:5/0 = 0
+8:5/0 = 0
+4:4/0 = 0
+5:3/0 = 0
+5:4/0 = 0
+0:6/next_alternative_id = 3
+0:6/0 = 0
+0:6/2 = 2
+1:6/next_alternative_id = 4
+1:6/0 = 0
+1:6/1 = 1
+1:6/1/flip_h = true
+1:6/2 = 2
+1:6/2/modulate = Color(1, 0.768627, 1, 1)
+1:6/3 = 3
+1:6/3/flip_h = true
+1:6/3/modulate = Color(1, 0.768627, 1, 1)
+2:6/0 = 0
+3:6/0 = 0
+4:6/0 = 0
+5:6/0 = 0
+6:6/0 = 0
+7:6/0 = 0
+8:6/0 = 0
+
+[resource]
+tile_shape = 3
+tile_size = Vector2i(65, 65)
+sources/0 = SubResource("TileSetAtlasSource_7xaig")
+sources/2 = SubResource("TileSetAtlasSource_0cmhd")

BIN
godot/component/entity/land/tileset_image.png


+ 34 - 0
godot/component/entity/land/tileset_image.png.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bw0b0ornoeb4m"
+path="res://.godot/imported/tileset_image.png-bc2248d47eda1485e8fb182d2ffd69f2.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://component/entity/land/tileset_image.png"
+dest_files=["res://.godot/imported/tileset_image.png-bc2248d47eda1485e8fb182d2ffd69f2.ctex"]
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/bptc_ldr=0
+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

+ 24 - 0
godot/component/entity/player/Player.gd

@@ -0,0 +1,24 @@
+extends CharacterBody2D
+
+
+const SPEED = 300.0
+
+
+func _physics_process(delta):
+
+
+	if Input.is_action_pressed("ui_right"):
+		velocity.x = SPEED
+	elif Input.is_action_pressed("ui_left"):
+		velocity.x = -SPEED
+	else:
+		velocity.x = move_toward(velocity.x, 0, SPEED)
+
+	if Input.is_action_pressed("ui_down"):
+		velocity.y = SPEED
+	elif Input.is_action_pressed("ui_up"):
+		velocity.y = -SPEED
+	else:
+		velocity.y = move_toward(velocity.y, 0, SPEED)
+
+	move_and_slide()

+ 18 - 0
godot/component/entity/player/Player.tscn

@@ -0,0 +1,18 @@
+[gd_scene load_steps=4 format=3 uid="uid://b8og3wlgvihed"]
+
+[ext_resource type="Script" path="res://component/entity/player/Player.gd" id="1_364t3"]
+[ext_resource type="Texture2D" uid="uid://cwhw2rx7twu2e" path="res://component/entity/player/smiley_character.png" id="2_y6vu3"]
+
+[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_qfhl8"]
+radius = 18.0
+height = 52.0
+
+[node name="Player" type="CharacterBody2D"]
+script = ExtResource("1_364t3")
+
+[node name="Body" type="CollisionShape2D" parent="."]
+position = Vector2(0, -1)
+shape = SubResource("CapsuleShape2D_qfhl8")
+
+[node name="Skin" type="Sprite2D" parent="."]
+texture = ExtResource("2_y6vu3")

BIN
godot/component/entity/player/smiley_character.png


+ 34 - 0
godot/component/entity/player/smiley_character.png.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://cwhw2rx7twu2e"
+path="res://.godot/imported/smiley_character.png-3e2048d5f97031b36131d4607f26b250.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://component/entity/player/smiley_character.png"
+dest_files=["res://.godot/imported/smiley_character.png-3e2048d5f97031b36131d4607f26b250.ctex"]
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_compression=1
+compress/bptc_ldr=0
+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

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 0
godot/icon.svg


+ 37 - 0
godot/icon.svg.import

@@ -0,0 +1,37 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://dy5g3iswdrc1t"
+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/lossy_quality=0.7
+compress/hdr_compression=1
+compress/bptc_ldr=0
+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
+svg/scale=1.0
+editor/scale_with_editor_scale=false
+editor/convert_colors_with_editor_theme=false

+ 16 - 0
godot/project.godot

@@ -0,0 +1,16 @@
+; 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="Dricom Dragon"
+run/main_scene="res://world.tscn"
+config/features=PackedStringArray("4.0", "Forward Plus")
+config/icon="res://icon.svg"

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 23 - 0
godot/world.tscn