diff --git a/godot/.import/default.png-13971fa1f37d4ea367b7aa5973d2bb0a.md5 b/godot/.import/default.png-13971fa1f37d4ea367b7aa5973d2bb0a.md5 new file mode 100644 index 0000000..1a50451 --- /dev/null +++ b/godot/.import/default.png-13971fa1f37d4ea367b7aa5973d2bb0a.md5 @@ -0,0 +1,3 @@ +source_md5="51a24b88d8d04d41bb08fb37210d0c1a" +dest_md5="9292fede89cc4d9fde79c618d8241bf7" + diff --git a/godot/.import/default.png-13971fa1f37d4ea367b7aa5973d2bb0a.stex b/godot/.import/default.png-13971fa1f37d4ea367b7aa5973d2bb0a.stex new file mode 100644 index 0000000..7bad8f5 Binary files /dev/null and b/godot/.import/default.png-13971fa1f37d4ea367b7aa5973d2bb0a.stex differ diff --git a/godot/.import/default.png-3bbe939339db863d2d767f4cc6888a76.md5 b/godot/.import/default.png-3bbe939339db863d2d767f4cc6888a76.md5 index 5bc58ef..065d655 100644 --- a/godot/.import/default.png-3bbe939339db863d2d767f4cc6888a76.md5 +++ b/godot/.import/default.png-3bbe939339db863d2d767f4cc6888a76.md5 @@ -1,3 +1,3 @@ -source_md5="7d76499be9b404817efc9b6091ecd3f7" -dest_md5="a8c8f2f79e2fef0ca5ca5b3b72c995ad" +source_md5="59c9436dc5ea53f2bc3dac38af894dec" +dest_md5="a62e530f259d2076dd7d2e62bc1d97b6" diff --git a/godot/.import/default.png-3bbe939339db863d2d767f4cc6888a76.stex b/godot/.import/default.png-3bbe939339db863d2d767f4cc6888a76.stex index b726df6..94f5e19 100644 Binary files a/godot/.import/default.png-3bbe939339db863d2d767f4cc6888a76.stex and b/godot/.import/default.png-3bbe939339db863d2d767f4cc6888a76.stex differ diff --git a/godot/project.godot b/godot/project.godot index 61743de..67446fa 100644 --- a/godot/project.godot +++ b/godot/project.godot @@ -38,6 +38,41 @@ texture={ "svg/scale": 1.0 } +[input] + +camera_left={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +camera_up={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +camera_right={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +camera_down={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +zoom_in={ +"deadzone": 0.5, +"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":true,"control":false,"meta":false,"command":false,"pressed":false,"scancode":61,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +zoom_out={ +"deadzone": 0.5, +"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":5,"pressed":false,"doubleclick":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":45,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} + [physics] common/enable_pause_aware_picking=true diff --git a/godot/saves.gd b/godot/saves.gd new file mode 100644 index 0000000..1eccaec --- /dev/null +++ b/godot/saves.gd @@ -0,0 +1,16 @@ +extends Node + + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass diff --git a/godot/sprite/tiles/default.png b/godot/sprite/tiles/default.png deleted file mode 100644 index ebdcad3..0000000 Binary files a/godot/sprite/tiles/default.png and /dev/null differ diff --git a/godot/sprite/tiles/terrain/default.png b/godot/sprite/tiles/terrain/default.png new file mode 100644 index 0000000..c094918 Binary files /dev/null and b/godot/sprite/tiles/terrain/default.png differ diff --git a/godot/sprite/tiles/default.png.import b/godot/sprite/tiles/terrain/default.png.import similarity index 71% rename from godot/sprite/tiles/default.png.import rename to godot/sprite/tiles/terrain/default.png.import index 6303f1f..aadb6f4 100644 --- a/godot/sprite/tiles/default.png.import +++ b/godot/sprite/tiles/terrain/default.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/default.png-3bbe939339db863d2d767f4cc6888a76.stex" +path="res://.import/default.png-13971fa1f37d4ea367b7aa5973d2bb0a.stex" metadata={ "vram_texture": false } [deps] -source_file="res://sprite/tiles/default.png" -dest_files=[ "res://.import/default.png-3bbe939339db863d2d767f4cc6888a76.stex" ] +source_file="res://sprite/tiles/terrain/default.png" +dest_files=[ "res://.import/default.png-13971fa1f37d4ea367b7aa5973d2bb0a.stex" ] [params] diff --git a/godot/world/terrain.gd b/godot/world/terrain.gd new file mode 100644 index 0000000..4a4af82 --- /dev/null +++ b/godot/world/terrain.gd @@ -0,0 +1,13 @@ +extends TileMap + +var width = 256 +var height = 256 + +# Called when the node enters the scene tree for the first time. +func _ready(): + fill() + +func fill(): + for x in width: + for y in height: + set_cell(x,y,0,false,false,false,Vector2(1,0)) diff --git a/godot/world/terrain/terrain.tres b/godot/world/terrain/terrain.tres new file mode 100644 index 0000000..d752c85 --- /dev/null +++ b/godot/world/terrain/terrain.tres @@ -0,0 +1,26 @@ +[gd_resource type="TileSet" load_steps=2 format=2] + +[ext_resource path="res://sprite/tiles/terrain/default.png" type="Texture" id=1] + +[resource] +0/name = "default.png 0" +0/texture = ExtResource( 1 ) +0/tex_offset = Vector2( 0, 0 ) +0/modulate = Color( 1, 1, 1, 1 ) +0/region = Rect2( 0, 0, 128, 128 ) +0/tile_mode = 2 +0/autotile/icon_coordinate = Vector2( 0, 0 ) +0/autotile/tile_size = Vector2( 32, 32 ) +0/autotile/spacing = 0 +0/autotile/occluder_map = [ ] +0/autotile/navpoly_map = [ ] +0/autotile/priority_map = [ ] +0/autotile/z_index_map = [ ] +0/occluder_offset = Vector2( 0, 0 ) +0/navigation_offset = Vector2( 0, 0 ) +0/shape_offset = Vector2( 0, 0 ) +0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +0/shape_one_way = false +0/shape_one_way_margin = 0.0 +0/shapes = [ ] +0/z_index = 0 diff --git a/godot/world/world.tscn b/godot/world/world.tscn index 1d5d587..e830d08 100644 --- a/godot/world/world.tscn +++ b/godot/world/world.tscn @@ -1,3 +1,29 @@ -[gd_scene format=2] +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://world/terrain/terrain.tres" type="TileSet" id=1] +[ext_resource path="res://world/terrain.gd" type="Script" id=2] +[ext_resource path="res://world/worldcam.gd" type="Script" id=3] [node name="World" type="Node2D"] + +[node name="terrain" type="TileMap" parent="."] +position = Vector2( -2, 0 ) +mode = 1 +tile_set = ExtResource( 1 ) +cell_size = Vector2( 32, 16 ) +format = 1 +tile_data = PoolIntArray( -393219, 0, 196609, -393218, 0, 196609, -393217, 0, 196609, -458752, 0, 196609, -458751, 0, 196609, -327683, 0, 196609, -327682, 0, 196609, -327681, 0, 196609, -393216, 0, 196609, -393215, 0, 196609, -393214, 0, 196609, -262147, 0, 196609, -262146, 0, 196609, -262145, 0, 196609, -327680, 0, 196609, -327679, 0, 196609, -327678, 0, 196609, -327677, 0, 196609, -196611, 0, 196609, -196610, 0, 196609, -196609, 0, 131072, -262144, 0, 196609, -262143, 0, 196609, -262142, 0, 196609, -262141, 0, 196609, -262140, 0, 196609, -131075, 0, 196609, -131074, 0, 196609, -131073, 0, 196609, -196608, 0, 196609, -196607, 0, 196609, -196606, 0, 196609, -196605, 0, 196609, -196604, 0, 196609, -196603, 0, 196609, -65539, 0, 196609, -65538, 0, 196609, -65537, 0, 196609, -131072, 0, 196609, -131071, 0, 196609, -131070, 0, 196609, -131069, 0, 196609, -131068, 0, 196609, -131067, 0, 196609, -131066, 0, 196609, -2, 0, 196609, -1, 0, 196609, -65536, 0, 196609, -65535, 0, 196609, -65534, 0, 196609, -65533, 0, 196609, -65532, 0, 196609, -65531, 0, 196609, -65530, 0, 196609, 65534, 0, 196609, 65535, 0, 196609, 0, 0, 196609, 1, 0, 196609, 2, 0, 196609, 3, 0, 196609, 4, 0, 196609, 131070, 0, 196609, 131071, 0, 196609, 65536, 0, 196609, 65537, 0, 196609, 65538, 0, 196609, 65539, 0, 196609, 65540, 0, 196609, 196607, 0, 196609, 131072, 0, 196609, 131073, 0, 196609, 131074, 0, 196609, 131075, 0, 196609, 131076, 0, 196609, 131077, 0, 196609, 196608, 0, 196609, 196609, 0, 196609, 196610, 0, 196609, 196611, 0, 196609, 196612, 0, 196609, 196613, 0, 196609, 262144, 0, 196609, 262145, 0, 196609, 262146, 0, 196609, 262147, 0, 196609, 262148, 0, 196609, 262149, 0, 196609, 327683, 0, 196609, 327684, 0, 196609 ) +script = ExtResource( 2 ) + +[node name="TileMap" type="TileMap" parent="."] +position = Vector2( -2, 0 ) +mode = 1 +tile_set = ExtResource( 1 ) +cell_size = Vector2( 32, 16 ) +format = 1 +tile_data = PoolIntArray( -196609, 0, 65539, -262144, 0, 65539, -262143, 0, 65539, -196608, 0, 65539, -196607, 0, 65536, -196606, 0, 65536, -196605, 0, 65539, -65537, 0, 65536, -131072, 0, 65536, -131071, 0, 65536, -131070, 0, 65536, -131069, 0, 65536, -131068, 0, 65536, -65536, 0, 65539, -65535, 0, 65539, -65534, 0, 196609, 1, 0, 65539, 2, 0, 2, 65537, 0, 2, 65538, 0, 196609 ) + +[node name="worldcam" type="Camera2D" parent="."] +current = true +zoom = Vector2( 0.4, 0.4 ) +script = ExtResource( 3 ) diff --git a/godot/world/worldcam.gd b/godot/world/worldcam.gd new file mode 100644 index 0000000..bad76d6 --- /dev/null +++ b/godot/world/worldcam.gd @@ -0,0 +1,21 @@ +extends Camera2D +export var min_zoom = 0.4 +export var speed = 200 +var zoomlevel = 0.4 + +func _process(delta): + move_around(delta) + handle_zoom() + +func move_around(delta): + var xdirection = Input.get_action_strength("camera_right") - Input.get_action_strength("camera_left") + var ydirection = Input.get_action_strength("camera_down") - Input.get_action_strength("camera_up") + var direction = Vector2(xdirection, ydirection).normalized() * delta * speed * zoom + position = lerp(position, position + direction, 2) + +func handle_zoom(): + if Input.is_action_just_pressed("zoom_in"): + zoomlevel = clamp(zoomlevel - 0.1, 0.1, 2) + if Input.is_action_just_pressed("zoom_out"): + zoomlevel = clamp(zoomlevel + 0.1, 0.1, 2) + zoom = Vector2(zoomlevel, zoomlevel) diff --git a/libresprite/mulfok62-1x.png b/libresprite/mulfok62-1x.png new file mode 100644 index 0000000..f7740af Binary files /dev/null and b/libresprite/mulfok62-1x.png differ diff --git a/libresprite/tiles/default.ase b/libresprite/tiles/default.ase index 8b75816..2ce53bf 100644 Binary files a/libresprite/tiles/default.ase and b/libresprite/tiles/default.ase differ