First commit

This commit is contained in:
termite 2025-05-02 16:22:30 -07:00
commit f5efda2cfc
18 changed files with 237 additions and 0 deletions

4
.editorconfig Normal file
View file

@ -0,0 +1,4 @@
root = true
[*]
charset = utf-8

2
.gitattributes vendored Normal file
View file

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

16
.gitignore vendored Normal file
View file

@ -0,0 +1,16 @@
# ---> Godot
# Godot 4+ specific ignores
.godot/
# Godot-specific ignores
.import/
export.cfg
export_presets.cfg
# Imported translations (automatically generated from CSV files)
*.translation
# Mono-specific ignores
.mono/
data_*/
mono_crash.*.json

1
icon.svg Normal file
View 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: 994 B

37
icon.svg.import Normal file
View file

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://de6072727efes"
path="res://.godot/imported/inventory-tile.png-d0903f412222a61cfaf624828d419428.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://inventory/inventory-tile.png"
dest_files=["res://.godot/imported/inventory-tile.png-d0903f412222a61cfaf624828d419428.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

14
inventory/inventory.gd Normal file
View file

@ -0,0 +1,14 @@
extends Control
var inventory : Array[Array]
func _ready():
inventory = [[0,0],[0,0]]
update_tiles()
func update_tiles():
%InventoryTiles.clear()
for y in range(len(inventory)):
for x in range(len(inventory[0])):
if inventory[y][x] != null:
%InventoryTiles.set_cell(Vector2i(x,y),0,Vector2i(0,0))

View file

@ -0,0 +1 @@
uid://cvwx472s1l0wh

27
inventory/inventory.tscn Normal file
View file

@ -0,0 +1,27 @@
[gd_scene load_steps=5 format=3 uid="uid://cquc6kpasvo7r"]
[ext_resource type="Script" uid="uid://cvwx472s1l0wh" path="res://inventory/inventory.gd" id="1_s83yu"]
[ext_resource type="Texture2D" uid="uid://de6072727efes" path="res://inventory/inventory-tile.png" id="2_qse2j"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_f8i2h"]
texture = ExtResource("2_qse2j")
0:0/0 = 0
[sub_resource type="TileSet" id="TileSet_70ao8"]
sources/0 = SubResource("TileSetAtlasSource_f8i2h")
[node name="Inventory" type="Control"]
layout_mode = 3
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_s83yu")
[node name="InventoryTiles" type="TileMapLayer" parent="."]
unique_name_in_owner = true
scale = Vector2(0.5, 0.5)
tile_set = SubResource("TileSet_70ao8")

20
item.gd Normal file
View file

@ -0,0 +1,20 @@
extends Node2D
class_name Item
var shape : Array[Array]
var inventory_position : Vector2i
var draggable = true
var dragging = false
var mouse_offset : Vector2
func _process(delta: float) -> void:
if dragging:
global_position = get_global_mouse_position() + mouse_offset
if Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT):
var mouse_difference = get_global_mouse_position() - position
if mouse_difference.x > 0 and mouse_difference.y > 0 and mouse_difference.x:

1
item.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://chy33igywiy8n

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://du35v4wya2pfm"
path="res://.godot/imported/power-capsule.png-f128d467353ce8a8f5eccfb699a31b8a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://items/power_capsule/power-capsule.png"
dest_files=["res://.godot/imported/power-capsule.png-f128d467353ce8a8f5eccfb699a31b8a.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

View file

@ -0,0 +1,4 @@
extends Item
func _init():
shape = [[true,true]]

View file

@ -0,0 +1 @@
uid://bh4vv4745n16i

View file

@ -0,0 +1,12 @@
[gd_scene load_steps=3 format=3 uid="uid://bhwd344v0r8lf"]
[ext_resource type="Script" uid="uid://bh4vv4745n16i" path="res://items/power_capsule/power_capsule.gd" id="1_4uwqi"]
[ext_resource type="Texture2D" uid="uid://du35v4wya2pfm" path="res://items/power_capsule/power-capsule.png" id="2_8reo3"]
[node name="PowerCapsule" type="Node2D" node_paths=PackedStringArray("selection_shape")]
script = ExtResource("1_4uwqi")
selection_shape = NodePath("")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(16, 8)
texture = ExtResource("2_8reo3")

29
project.godot Normal file
View file

@ -0,0 +1,29 @@
; 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="Knockoff"
config/features=PackedStringArray("4.4", "GL Compatibility")
config/icon="res://icon.svg"
[display]
window/size/viewport_width=213
window/size/viewport_height=120
window/stretch/mode="canvas_items"
window/stretch/aspect="expand"
window/per_pixel_transparency/allowed=true
[rendering]
textures/canvas_textures/default_texture_filter=0
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"