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 0000000..fcd7e5a Binary files /dev/null and b/tiles.xcf differ