From 30287c6fc39baf1b936d45a5c57a96351a900828 Mon Sep 17 00:00:00 2001 From: Nekojimi Date: Mon, 14 Mar 2022 19:04:32 +0000 Subject: [PATCH] Added stuff & things --- DebugCanvas.gd | 16 ++++++++ Pickup.tscn | 11 ++++++ Player.gd | 51 ++++++++++++++++++++++++++ Player.gdns | 5 +++ Player.tscn | 13 +++++++ Scene.gd | 74 +++++++++++++++++++++++++++++++++++++ Scene.tscn | 93 +++++++++++++++++++++++++++++++++++++++++++++++ default_env.tres | 2 + icon.png.import | 8 +--- project.godot | 60 +++++++++++++++++++++++++++++- tiles.png | 3 ++ tiles.png.import | 34 +++++++++++++++++ tiles.xcf | Bin 0 -> 10401 bytes 13 files changed, 362 insertions(+), 8 deletions(-) create mode 100644 DebugCanvas.gd create mode 100644 Pickup.tscn create mode 100644 Player.gd create mode 100644 Player.gdns create mode 100644 Player.tscn create mode 100644 Scene.gd create mode 100644 Scene.tscn create mode 100644 tiles.png create mode 100644 tiles.png.import create mode 100644 tiles.xcf diff --git a/DebugCanvas.gd b/DebugCanvas.gd new file mode 100644 index 0000000..d53f3bf --- /dev/null +++ b/DebugCanvas.gd @@ -0,0 +1,16 @@ +extends Node2D + +const OFFSET: Vector2 = Vector2(16,16) + +func _draw() -> void: + for cellGraphData in get_parent().cellGraph: + for link in cellGraphData.links: + var from: Vector2 = get_parent().map_pos(cellGraphData.cell) + OFFSET + var to: Vector2 = get_parent().map_pos(link) + OFFSET + from = from.move_toward(to,10) + draw_line( + from, + to, + Color.blueviolet, + 2.0, + true) diff --git a/Pickup.tscn b/Pickup.tscn new file mode 100644 index 0000000..d9abff2 --- /dev/null +++ b/Pickup.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://tiles.png" type="Texture" id=1] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 1 ) +region = Rect2( 32, 32, 32, 32 ) + +[node name="Pickup" type="Sprite"] +texture = SubResource( 1 ) +offset = Vector2( 16, 16 ) diff --git a/Player.gd b/Player.gd new file mode 100644 index 0000000..4a66c22 --- /dev/null +++ b/Player.gd @@ -0,0 +1,51 @@ +extends Node2D + + +# Declare member variables here. Examples: +# var a: int = 2 +# var b: String = "text" + +var gridPos: Vector2 = Vector2(0,0) +var lastPos: Vector2 = Vector2(0,0) +var anim : float = 0.0 + +const ANIM_SPEED : float = 0.02 + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + gridPos = get_parent().world_to_map(position) + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + var duration: float = (lastPos - gridPos).length() * ANIM_SPEED + if (duration <= 0): + anim = 1.0 + if (anim < 1.0): + anim = min(anim + delta / duration, 1.0) + + position = get_parent().map_pos(lerp(lastPos,gridPos,anim)) + +func _input(event: InputEvent) -> void: + if event.is_action_pressed("game_up"): + move(Vector2(0,-1)) + elif event.is_action_pressed("game_up_left"): + move(Vector2(-1,-1)) + elif event.is_action_pressed("game_left"): + move(Vector2(-1,0)) + elif event.is_action_pressed("game_down_left"): + move(Vector2(-1,1)) + elif event.is_action_pressed("game_down"): + move(Vector2(0,1)) + elif event.is_action_pressed("game_down_right"): + move(Vector2(1,1)) + elif event.is_action_pressed("game_right"): + move(Vector2(1,0)) + elif event.is_action_pressed("game_up_right"): + move(Vector2(1,-1)) + +func move(dir: Vector2): + lastPos = gridPos + gridPos = get_parent().find_move(gridPos,dir) + anim = 0 + diff --git a/Player.gdns b/Player.gdns new file mode 100644 index 0000000..98a1843 --- /dev/null +++ b/Player.gdns @@ -0,0 +1,5 @@ +[gd_resource type="NativeScript" format=2] + +[resource] +resource_name = "Player" +class_name = "Player" diff --git a/Player.tscn b/Player.tscn new file mode 100644 index 0000000..0f1ddb5 --- /dev/null +++ b/Player.tscn @@ -0,0 +1,13 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://Player.gd" type="Script" id=1] +[ext_resource path="res://tiles.png" type="Texture" id=2] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 2 ) +region = Rect2( 0, 0, 32, 32 ) + +[node name="Player" type="Sprite"] +texture = SubResource( 1 ) +offset = Vector2( 16, 16 ) +script = ExtResource( 1 ) diff --git a/Scene.gd b/Scene.gd new file mode 100644 index 0000000..4464e0b --- /dev/null +++ b/Scene.gd @@ -0,0 +1,74 @@ +extends TileMap + +enum TileType {WALL = 2, BLANK = 3, HOLE = 4, STOP = 5} + +const tileTable: Array = [TileType.BLANK,TileType.BLANK,TileType.WALL,TileType.HOLE,TileType.STOP] +var cellGraph: Array +var nextRow: int = -1 + +func _ready() -> void: + generate(get_used_cells()) + +func generate(cells: Array): + for cell in cells: + var tile: int = tileTable[rand_range(0,tileTable.size())] + set_cellv(cell,tile) + + for cell in cells: + var cellGraphData: CellGraphData = CellGraphData.new() + cellGraphData.cell = cell + + for x in range(-1,2): + for y in range(-1,2): + if (x == 0 && y == 0): + continue + var tile: int = get_cellv(cell) + if (tile == TileType.WALL || tile == TileType.HOLE): + continue + var move: Vector2 = find_move(cell, Vector2(x,y)) + if (move == cell): + continue + var moveTile: int = get_cellv(move) + if (moveTile == TileType.WALL || moveTile == TileType.HOLE): + continue + cellGraphData.links.append(move) + + cellGraph.append(cellGraphData) + +func map_pos(grid: Vector2) -> Vector2: + return cell_size * grid + +func find_move(from: Vector2, dir: Vector2) -> Vector2: + var curPos: Vector2 = from + var cont: bool = true + + while (cont): + var nextPos: Vector2 = curPos + dir + + var nextCell: int = get_cellv(nextPos) + if (nextCell == TileType.WALL): # wall + return curPos + elif (nextCell == TileType.STOP || nextCell == TileType.HOLE): # stop or hole + return nextPos + elif (nextCell == TileMap.INVALID_CELL): + return nextPos + else: + curPos = nextPos + + return Vector2(-1,-1) + +func _process(delta: float) -> void: + position.y += delta * 3 + + if (position.y > (cell_size.y * abs(nextRow))): + print("Generating row " + String(nextRow)) + nextRow += 1 + var toGenerate: Array = [] + for x in range(get_used_rect().size.x): + toGenerate.append(Vector2(x,-nextRow)) + + generate(toGenerate) + +class CellGraphData: + var cell: Vector2 + var links: Array diff --git a/Scene.tscn b/Scene.tscn new file mode 100644 index 0000000..50a54b9 --- /dev/null +++ b/Scene.tscn @@ -0,0 +1,93 @@ +[gd_scene load_steps=8 format=2] + +[ext_resource path="res://Pickup.tscn" type="PackedScene" id=1] +[ext_resource path="res://tiles.png" type="Texture" id=2] +[ext_resource path="res://Scene.gd" type="Script" id=3] +[ext_resource path="res://DebugCanvas.gd" type="Script" id=4] +[ext_resource path="res://Player.tscn" type="PackedScene" id=5] + +[sub_resource type="ConvexPolygonShape2D" id=1] +points = PoolVector2Array( 32, 32, 0, 32, 0, 0, 32, 0 ) + +[sub_resource type="TileSet" id=2] +2/name = "tiles.png 2" +2/texture = ExtResource( 2 ) +2/tex_offset = Vector2( 0, 0 ) +2/modulate = Color( 1, 1, 1, 1 ) +2/region = Rect2( 32, 0, 32, 32 ) +2/tile_mode = 0 +2/occluder_offset = Vector2( 0, 0 ) +2/navigation_offset = Vector2( 0, 0 ) +2/shape_offset = Vector2( 0, 0 ) +2/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +2/shape = SubResource( 1 ) +2/shape_one_way = false +2/shape_one_way_margin = 1.0 +2/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 1 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +2/z_index = 0 +3/name = "tiles.png 3" +3/texture = ExtResource( 2 ) +3/tex_offset = Vector2( 0, 0 ) +3/modulate = Color( 1, 1, 1, 1 ) +3/region = Rect2( 64, 0, 32, 32 ) +3/tile_mode = 0 +3/occluder_offset = Vector2( 0, 0 ) +3/navigation_offset = Vector2( 0, 0 ) +3/shape_offset = Vector2( 0, 0 ) +3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +3/shape_one_way = false +3/shape_one_way_margin = 0.0 +3/shapes = [ ] +3/z_index = 0 +4/name = "tiles.png 4" +4/texture = ExtResource( 2 ) +4/tex_offset = Vector2( 0, 0 ) +4/modulate = Color( 1, 1, 1, 1 ) +4/region = Rect2( 96, 0, 32, 32 ) +4/tile_mode = 0 +4/occluder_offset = Vector2( 0, 0 ) +4/navigation_offset = Vector2( 0, 0 ) +4/shape_offset = Vector2( 0, 0 ) +4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +4/shape_one_way = false +4/shape_one_way_margin = 0.0 +4/shapes = [ ] +4/z_index = 0 +5/name = "tiles.png 5" +5/texture = ExtResource( 2 ) +5/tex_offset = Vector2( 0, 0 ) +5/modulate = Color( 1, 1, 1, 1 ) +5/region = Rect2( 0, 32, 32, 32 ) +5/tile_mode = 0 +5/occluder_offset = Vector2( 0, 0 ) +5/navigation_offset = Vector2( 0, 0 ) +5/shape_offset = Vector2( 0, 0 ) +5/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +5/shape_one_way = false +5/shape_one_way_margin = 0.0 +5/shapes = [ ] +5/z_index = 0 + +[node name="Scene" type="TileMap"] +tile_set = SubResource( 2 ) +cell_size = Vector2( 32, 32 ) +centered_textures = true +format = 1 +tile_data = PoolIntArray( 0, 2, 0, 1, 3, 0, 2, 3, 0, 3, 3, 0, 4, 3, 0, 5, 3, 0, 6, 3, 0, 7, 3, 0, 8, 3, 0, 9, 3, 0, 10, 3, 0, 11, 3, 0, 12, 2, 0, 13, 3, 0, 14, 3, 0, 15, 3, 0, 16, 4, 0, 17, 3, 0, 18, 3, 0, 19, 3, 0, 20, 3, 0, 21, 3, 0, 22, 3, 0, 23, 3, 0, 24, 4, 0, 25, 3, 0, 26, 3, 0, 27, 3, 0, 28, 3, 0, 29, 3, 0, 30, 3, 0, 31, 3, 0, 65536, 3, 0, 65537, 2, 0, 65538, 3, 0, 65539, 3, 0, 65540, 3, 0, 65541, 3, 0, 65542, 3, 0, 65543, 3, 0, 65544, 3, 0, 65545, 3, 0, 65546, 3, 0, 65547, 3, 0, 65548, 3, 0, 65549, 3, 0, 65550, 3, 0, 65551, 3, 0, 65552, 3, 0, 65553, 3, 0, 65554, 3, 0, 65555, 3, 0, 65556, 3, 0, 65557, 3, 0, 65558, 3, 0, 65559, 3, 0, 65560, 3, 0, 65561, 3, 0, 65562, 3, 0, 65563, 5, 0, 65564, 3, 0, 65565, 3, 0, 65566, 3, 0, 65567, 3, 0, 131072, 3, 0, 131073, 3, 0, 131074, 2, 0, 131075, 3, 0, 131076, 4, 0, 131077, 4, 0, 131078, 5, 0, 131079, 3, 0, 131080, 3, 0, 131081, 2, 0, 131082, 3, 0, 131083, 3, 0, 131084, 5, 0, 131085, 5, 0, 131086, 3, 0, 131087, 3, 0, 131088, 3, 0, 131089, 3, 0, 131090, 3, 0, 131091, 3, 0, 131092, 3, 0, 131093, 2, 0, 131094, 3, 0, 131095, 3, 0, 131096, 3, 0, 131097, 3, 0, 131098, 3, 0, 131099, 3, 0, 131100, 4, 0, 131101, 3, 0, 131102, 3, 0, 131103, 3, 0, 196608, 3, 0, 196609, 3, 0, 196610, 3, 0, 196611, 3, 0, 196612, 4, 0, 196613, 3, 0, 196614, 3, 0, 196615, 3, 0, 196616, 3, 0, 196617, 3, 0, 196618, 3, 0, 196619, 3, 0, 196620, 3, 0, 196621, 3, 0, 196622, 3, 0, 196623, 3, 0, 196624, 3, 0, 196625, 3, 0, 196626, 3, 0, 196627, 4, 0, 196628, 3, 0, 196629, 3, 0, 196630, 3, 0, 196631, 3, 0, 196632, 3, 0, 196633, 3, 0, 196634, 3, 0, 196635, 3, 0, 196636, 3, 0, 196637, 3, 0, 196638, 3, 0, 196639, 3, 0, 262144, 3, 0, 262145, 4, 0, 262146, 3, 0, 262147, 3, 0, 262148, 3, 0, 262149, 3, 0, 262150, 3, 0, 262151, 3, 0, 262152, 3, 0, 262153, 3, 0, 262154, 3, 0, 262155, 3, 0, 262156, 3, 0, 262157, 3, 0, 262158, 3, 0, 262159, 3, 0, 262160, 3, 0, 262161, 3, 0, 262162, 5, 0, 262163, 3, 0, 262164, 3, 0, 262165, 3, 0, 262166, 3, 0, 262167, 3, 0, 262168, 5, 0, 262169, 3, 0, 262170, 3, 0, 262171, 3, 0, 262172, 3, 0, 262173, 2, 0, 262174, 3, 0, 262175, 3, 0, 327680, 3, 0, 327681, 3, 0, 327682, 3, 0, 327683, 3, 0, 327684, 3, 0, 327685, 3, 0, 327686, 3, 0, 327687, 3, 0, 327688, 2, 0, 327689, 2, 0, 327690, 2, 0, 327691, 2, 0, 327692, 3, 0, 327693, 3, 0, 327694, 3, 0, 327695, 3, 0, 327696, 3, 0, 327697, 3, 0, 327698, 3, 0, 327699, 3, 0, 327700, 3, 0, 327701, 3, 0, 327702, 3, 0, 327703, 3, 0, 327704, 3, 0, 327705, 3, 0, 327706, 3, 0, 327707, 3, 0, 327708, 3, 0, 327709, 2, 0, 327710, 3, 0, 327711, 3, 0, 393216, 3, 0, 393217, 3, 0, 393218, 3, 0, 393219, 4, 0, 393220, 3, 0, 393221, 3, 0, 393222, 3, 0, 393223, 2, 0, 393224, 3, 0, 393225, 3, 0, 393226, 3, 0, 393227, 3, 0, 393228, 3, 0, 393229, 3, 0, 393230, 5, 0, 393231, 3, 0, 393232, 3, 0, 393233, 3, 0, 393234, 3, 0, 393235, 3, 0, 393236, 3, 0, 393237, 3, 0, 393238, 3, 0, 393239, 3, 0, 393240, 3, 0, 393241, 3, 0, 393242, 3, 0, 393243, 2, 0, 393244, 3, 0, 393245, 2, 0, 393246, 3, 0, 393247, 3, 0, 458752, 3, 0, 458753, 2, 0, 458754, 3, 0, 458755, 3, 0, 458756, 3, 0, 458757, 5, 0, 458758, 3, 0, 458759, 3, 0, 458760, 5, 0, 458761, 3, 0, 458762, 3, 0, 458763, 3, 0, 458764, 3, 0, 458765, 3, 0, 458766, 2, 0, 458767, 3, 0, 458768, 3, 0, 458769, 3, 0, 458770, 3, 0, 458771, 3, 0, 458772, 3, 0, 458773, 3, 0, 458774, 3, 0, 458775, 5, 0, 458776, 3, 0, 458777, 3, 0, 458778, 3, 0, 458779, 3, 0, 458780, 3, 0, 458781, 3, 0, 458782, 3, 0, 458783, 3, 0, 524288, 3, 0, 524289, 5, 0, 524290, 2, 0, 524291, 3, 0, 524292, 3, 0, 524293, 5, 0, 524294, 3, 0, 524295, 3, 0, 524296, 3, 0, 524297, 5, 0, 524298, 3, 0, 524299, 2, 0, 524300, 3, 0, 524301, 3, 0, 524302, 3, 0, 524303, 3, 0, 524304, 3, 0, 524305, 3, 0, 524306, 5, 0, 524307, 3, 0, 524308, 3, 0, 524309, 3, 0, 524310, 3, 0, 524311, 3, 0, 524312, 3, 0, 524313, 3, 0, 524314, 3, 0, 524315, 3, 0, 524316, 3, 0, 524317, 3, 0, 524318, 3, 0, 524319, 3, 0, 589824, 3, 0, 589825, 3, 0, 589826, 3, 0, 589827, 3, 0, 589828, 3, 0, 589829, 3, 0, 589830, 3, 0, 589831, 3, 0, 589832, 3, 0, 589833, 3, 0, 589834, 2, 0, 589835, 3, 0, 589836, 3, 0, 589837, 3, 0, 589838, 3, 0, 589839, 3, 0, 589840, 3, 0, 589841, 3, 0, 589842, 3, 0, 589843, 5, 0, 589844, 3, 0, 589845, 3, 0, 589846, 2, 0, 589847, 3, 0, 589848, 3, 0, 589849, 3, 0, 589850, 3, 0, 589851, 5, 0, 589852, 3, 0, 589853, 3, 0, 589854, 3, 0, 589855, 3, 0, 655360, 3, 0, 655361, 3, 0, 655362, 3, 0, 655363, 4, 0, 655364, 3, 0, 655365, 3, 0, 655366, 2, 0, 655367, 2, 0, 655368, 2, 0, 655369, 2, 0, 655370, 3, 0, 655371, 2, 0, 655372, 3, 0, 655373, 3, 0, 655374, 3, 0, 655375, 2, 0, 655376, 3, 0, 655377, 4, 0, 655378, 3, 0, 655379, 3, 0, 655380, 3, 0, 655381, 3, 0, 655382, 3, 0, 655383, 3, 0, 655384, 3, 0, 655385, 3, 0, 655386, 3, 0, 655387, 3, 0, 655388, 3, 0, 655389, 3, 0, 655390, 3, 0, 655391, 3, 0, 720896, 3, 0, 720897, 3, 0, 720898, 3, 0, 720899, 3, 0, 720900, 3, 0, 720901, 3, 0, 720902, 3, 0, 720903, 3, 0, 720904, 3, 0, 720905, 3, 0, 720906, 3, 0, 720907, 3, 0, 720908, 3, 0, 720909, 3, 0, 720910, 3, 0, 720911, 3, 0, 720912, 3, 0, 720913, 3, 0, 720914, 3, 0, 720915, 3, 0, 720916, 3, 0, 720917, 3, 0, 720918, 3, 0, 720919, 3, 0, 720920, 3, 0, 720921, 3, 0, 720922, 3, 0, 720923, 3, 0, 720924, 2, 0, 720925, 3, 0, 720926, 3, 0, 720927, 3, 0, 786432, 3, 0, 786433, 3, 0, 786434, 3, 0, 786435, 3, 0, 786436, 3, 0, 786437, 3, 0, 786438, 3, 0, 786439, 3, 0, 786440, 3, 0, 786441, 3, 0, 786442, 3, 0, 786443, 3, 0, 786444, 3, 0, 786445, 3, 0, 786446, 3, 0, 786447, 3, 0, 786448, 5, 0, 786449, 3, 0, 786450, 3, 0, 786451, 5, 0, 786452, 3, 0, 786453, 3, 0, 786454, 3, 0, 786455, 3, 0, 786456, 3, 0, 786457, 3, 0, 786458, 3, 0, 786459, 4, 0, 786460, 3, 0, 786461, 5, 0, 786462, 3, 0, 786463, 3, 0, 851968, 3, 0, 851969, 3, 0, 851970, 3, 0, 851971, 3, 0, 851972, 5, 0, 851973, 3, 0, 851974, 3, 0, 851975, 3, 0, 851976, 3, 0, 851977, 3, 0, 851978, 3, 0, 851979, 5, 0, 851980, 3, 0, 851981, 3, 0, 851982, 3, 0, 851983, 3, 0, 851984, 3, 0, 851985, 3, 0, 851986, 3, 0, 851987, 3, 0, 851988, 3, 0, 851989, 3, 0, 851990, 3, 0, 851991, 3, 0, 851992, 3, 0, 851993, 3, 0, 851994, 3, 0, 851995, 3, 0, 851996, 3, 0, 851997, 3, 0, 851998, 3, 0, 851999, 3, 0, 917504, 3, 0, 917505, 3, 0, 917506, 3, 0, 917507, 3, 0, 917508, 3, 0, 917509, 3, 0, 917510, 3, 0, 917511, 3, 0, 917512, 3, 0, 917513, 3, 0, 917514, 3, 0, 917515, 3, 0, 917516, 3, 0, 917517, 3, 0, 917518, 3, 0, 917519, 3, 0, 917520, 3, 0, 917521, 3, 0, 917522, 3, 0, 917523, 3, 0, 917524, 3, 0, 917525, 3, 0, 917526, 3, 0, 917527, 3, 0, 917528, 3, 0, 917529, 3, 0, 917530, 3, 0, 917531, 3, 0, 917532, 3, 0, 917533, 3, 0, 917534, 3, 0, 917535, 3, 0, 983040, 3, 0, 983041, 2, 0, 983042, 3, 0, 983043, 3, 0, 983044, 3, 0, 983045, 3, 0, 983046, 5, 0, 983047, 3, 0, 983048, 3, 0, 983049, 3, 0, 983050, 3, 0, 983051, 3, 0, 983052, 3, 0, 983053, 3, 0, 983054, 2, 0, 983055, 3, 0, 983056, 3, 0, 983057, 3, 0, 983058, 3, 0, 983059, 3, 0, 983060, 2, 0, 983061, 3, 0, 983062, 3, 0, 983063, 3, 0, 983064, 3, 0, 983065, 2, 0, 983066, 2, 0, 983067, 2, 0, 983068, 3, 0, 983069, 3, 0, 983070, 3, 0, 983071, 3, 0, 1048576, 3, 0, 1048577, 2, 0, 1048578, 2, 0, 1048579, 3, 0, 1048580, 3, 0, 1048581, 3, 0, 1048582, 3, 0, 1048583, 3, 0, 1048584, 2, 0, 1048585, 3, 0, 1048586, 3, 0, 1048587, 4, 0, 1048588, 3, 0, 1048589, 3, 0, 1048590, 3, 0, 1048591, 3, 0, 1048592, 3, 0, 1048593, 3, 0, 1048594, 3, 0, 1048595, 3, 0, 1048596, 3, 0, 1048597, 3, 0, 1048598, 3, 0, 1048599, 3, 0, 1048600, 3, 0, 1048601, 3, 0, 1048602, 3, 0, 1048603, 3, 0, 1048604, 3, 0, 1048605, 3, 0, 1048606, 3, 0, 1048607, 3, 0, 1114112, 3, 0, 1114113, 3, 0, 1114114, 3, 0, 1114115, 3, 0, 1114116, 3, 0, 1114117, 3, 0, 1114118, 3, 0, 1114119, 3, 0, 1114120, 3, 0, 1114121, 3, 0, 1114122, 3, 0, 1114123, 3, 0, 1114124, 3, 0, 1114125, 3, 0, 1114126, 3, 0, 1114127, 3, 0, 1114128, 2, 0, 1114129, 2, 0, 1114130, 3, 0, 1114131, 3, 0, 1114132, 4, 0, 1114133, 3, 0, 1114134, 3, 0, 1114135, 3, 0, 1114136, 3, 0, 1114137, 2, 0, 1114138, 3, 0, 1114139, 3, 0, 1114140, 3, 0, 1114141, 3, 0, 1114142, 3, 0, 1114143, 3, 0, 1179648, 3, 0, 1179649, 3, 0, 1179650, 4, 0, 1179651, 3, 0, 1179652, 3, 0, 1179653, 3, 0, 1179654, 3, 0, 1179655, 3, 0, 1179656, 4, 0, 1179657, 3, 0, 1179658, 3, 0, 1179659, 3, 0, 1179660, 3, 0, 1179661, 3, 0, 1179662, 3, 0, 1179663, 3, 0, 1179664, 3, 0, 1179665, 3, 0, 1179666, 3, 0, 1179667, 3, 0, 1179668, 3, 0, 1179669, 3, 0, 1179670, 5, 0, 1179671, 3, 0, 1179672, 3, 0, 1179673, 3, 0, 1179674, 3, 0, 1179675, 3, 0, 1179676, 3, 0, 1179677, 3, 0, 1179678, 3, 0, 1179679, 3, 0 ) +script = ExtResource( 3 ) + +[node name="Player" parent="." instance=ExtResource( 5 )] +position = Vector2( 575.744, 545.291 ) + +[node name="DebugCanvas" type="Node2D" parent="."] +visible = false +script = ExtResource( 4 ) + +[node name="Pickup" parent="." instance=ExtResource( 1 )] +position = Vector2( 256.612, 191.881 ) diff --git a/default_env.tres b/default_env.tres index 98f26a7..20207a4 100644 --- a/default_env.tres +++ b/default_env.tres @@ -1,5 +1,7 @@ [gd_resource type="Environment" load_steps=2 format=2] + [sub_resource type="ProceduralSky" id=1] + [resource] background_mode = 2 background_sky = SubResource( 1 ) diff --git a/icon.png.import b/icon.png.import index a4c02e6..ec25265 100644 --- a/icon.png.import +++ b/icon.png.import @@ -2,16 +2,11 @@ importer="texture" type="StreamTexture" -path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" -metadata={ -"vram_texture": false -} +valid=false [deps] source_file="res://icon.png" -dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] - [params] compress/mode=0 @@ -28,7 +23,6 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false -process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/project.godot b/project.godot index 8366a61..774f33c 100644 --- a/project.godot +++ b/project.godot @@ -20,17 +20,75 @@ _global_script_class_icons={ [application] -config/name="${REPO_NAME}" +config/name="Momentum" +run/main_scene="res://Scene.tscn" config/icon="res://icon.png" +[debug] + +settings/stdout/print_fps=true +gdscript/warnings/treat_warnings_as_errors=true + [gdnative] singletons=[ "res://addons/godot-git-plugin/git_api.gdnlib" ] +[input] + +game_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,"unicode":0,"echo":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":16777358,"unicode":0,"echo":false,"script":null) + ] +} +game_up_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":81,"unicode":0,"echo":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":16777357,"unicode":0,"echo":false,"script":null) + ] +} +game_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,"unicode":0,"echo":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":16777354,"unicode":0,"echo":false,"script":null) + ] +} +game_down_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":90,"unicode":0,"echo":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":16777351,"unicode":0,"echo":false,"script":null) + ] +} +game_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":88,"unicode":0,"echo":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":16777352,"unicode":0,"echo":false,"script":null) + ] +} +game_down_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":67,"unicode":0,"echo":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":16777353,"unicode":0,"echo":false,"script":null) + ] +} +game_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,"unicode":0,"echo":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":16777356,"unicode":0,"echo":false,"script":null) + ] +} +game_up_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":69,"unicode":0,"echo":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":16777359,"unicode":0,"echo":false,"script":null) + ] +} + [physics] common/enable_pause_aware_picking=true [rendering] +quality/filters/msaa=2 environment/default_environment="res://default_env.tres" diff --git a/tiles.png b/tiles.png new file mode 100644 index 0000000..aab235e --- /dev/null +++ b/tiles.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f44f18914a98fe9262d0b57b757d424ed0ee246b591a56d03fde096387a3d6a +size 6728 diff --git a/tiles.png.import b/tiles.png.import new file mode 100644 index 0000000..7fb3165 --- /dev/null +++ b/tiles.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/tiles.png-20e12ed313f9b52ca4483ea23302e684.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://tiles.png" +dest_files=[ "res://.import/tiles.png-20e12ed313f9b52ca4483ea23302e684.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/tiles.xcf b/tiles.xcf new file mode 100644 index 0000000000000000000000000000000000000000..fcd7e5ae1ca5218c1182d5116d44ed48397fd7a1 GIT binary patch literal 10401 zcmaKS2Urxzwtr9eWQHLR!Vm^VRLrQWqBw{Om{`RKj0r~uSP7B@RC16Y+Jb_(W>{Bu z4ZDgMVD4V`-hJ=wef!;ecke1jU=)l<4imfor)JP)zwdqj!Je+F-|w8NbLv!`?i!MXP=1)>aD-z=plO>Z(w`s}IJ0m4CO@BV#0Pp-iU>}L;55XBJdmj~R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