diff --git a/intro.tscn b/intro.tscn new file mode 100644 index 0000000..6fed462 --- /dev/null +++ b/intro.tscn @@ -0,0 +1,87 @@ +[gd_scene load_steps=4 format=3 uid="uid://bvpapqp51vojr"] + +[ext_resource type="Texture2D" uid="uid://s7xmd65hltuh" path="res://sprites/Tileset.png" id="1_3c64q"] + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_hnpma"] +texture = ExtResource("1_3c64q") +texture_region_size = Vector2i(32, 32) +1:0/0 = 0 +1:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:0/0/physics_layer_0/angular_velocity = 0.0 +1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +2:0/0 = 0 +2:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:0/0/physics_layer_0/angular_velocity = 0.0 +2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +3:0/0 = 0 +3:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:0/0/physics_layer_0/angular_velocity = 0.0 +3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +0:1/0 = 0 +0:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:1/0/physics_layer_0/angular_velocity = 0.0 +0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +1:1/0 = 0 +1:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:1/0/physics_layer_0/angular_velocity = 0.0 +1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +3:1/0 = 0 +3:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:1/0/physics_layer_0/angular_velocity = 0.0 +3:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(16, -16, -16, -16, -16, 16, 16, 16) +4:1/0 = 0 +4:1/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:1/0/physics_layer_0/angular_velocity = 0.0 +4:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +0:2/0 = 0 +0:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:2/0/physics_layer_0/angular_velocity = 0.0 +0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +2:2/0 = 0 +2:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:2/0/physics_layer_0/angular_velocity = 0.0 +2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +4:2/0 = 0 +4:2/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:2/0/physics_layer_0/angular_velocity = 0.0 +4:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +0:3/0 = 0 +0:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +0:3/0/physics_layer_0/angular_velocity = 0.0 +0:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +1:3/0 = 0 +1:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:3/0/physics_layer_0/angular_velocity = 0.0 +1:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +3:3/0 = 0 +3:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:3/0/physics_layer_0/angular_velocity = 0.0 +3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(16, -16, 16, 16, -16, 16, -16, -16) +4:3/0 = 0 +4:3/0/physics_layer_0/linear_velocity = Vector2(0, 0) +4:3/0/physics_layer_0/angular_velocity = 0.0 +4:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +1:4/0 = 0 +1:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +1:4/0/physics_layer_0/angular_velocity = 0.0 +1:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +2:4/0 = 0 +2:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +2:4/0/physics_layer_0/angular_velocity = 0.0 +2:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) +3:4/0 = 0 +3:4/0/physics_layer_0/linear_velocity = Vector2(0, 0) +3:4/0/physics_layer_0/angular_velocity = 0.0 +3:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) + +[sub_resource type="TileSet" id="TileSet_w83xb"] +tile_size = Vector2i(32, 32) +physics_layer_0/collision_layer = 1 +sources/1 = SubResource("TileSetAtlasSource_hnpma") + +[node name="Intro" type="Node2D"] + +[node name="TileMap" type="TileMap" parent="."] +tile_set = SubResource("TileSet_w83xb") +format = 2 +layer_0/tile_data = PackedInt32Array(0, 131073, 0, 1, 131073, 0, 2, 131073, 0, 3, 131073, 0, 4, 131073, 0, 5, 131073, 0, 6, 131073, 0, 7, 131073, 0, 8, 131073, 0, 9, 131073, 0, 10, 131073, 0, -65525, 1, 2, -131061, 1, 2, -196597, 65537, 0, -1, 262145, 2, -65537, 262145, 2, -131073, 262145, 2, 65535, 196609, 1, 11, 65537, 1, -196596, 131073, 0, -196595, 131073, 0, -196594, 131073, 0, -262129, 1, 2, -327665, 1, 2, -393201, 1, 2, -458737, 1, 2, -524273, 1, 2, -589809, 1, 2, -655345, 1, 2, -196609, 262145, 2, -262145, 262145, 2, -327681, 262145, 2, -393217, 262145, 2, -458753, 262145, 2, -524289, 262145, 2, -589825, 262145, 2, -196593, 65537, 1) diff --git a/player.gd b/player.gd deleted file mode 100644 index 433e465..0000000 --- a/player.gd +++ /dev/null @@ -1,44 +0,0 @@ -extends CharacterBody2D - - -const SPEED = 300.0 -const JUMP_VELOCITY = -300.0 - -# Get the gravity from the project settings to be synced with RigidBody nodes. -var gravity = ProjectSettings.get_setting("physics/2d/default_gravity") -#own variables see tutorial 2 -var is_jumping = false -@onready var animated_sprite_2d = $AnimatedSprite2D - - -func _physics_process(delta): - # Add the gravity. - if not is_on_floor(): - velocity.y += gravity * delta - else: - is_jumping = false - - # Handle jump. - if Input.is_action_just_pressed("ui_accept") and is_on_floor(): - velocity.y = JUMP_VELOCITY - is_jumping = true - - # Get the input direction and handle the movement/deceleration. - # As good practice, you should replace UI actions with custom gameplay actions. - var direction = Input.get_axis("ui_left", "ui_right") - if direction: - velocity.x = direction * SPEED - else: - velocity.x = move_toward(velocity.x, 0, SPEED) - update_animation(direction) - move_and_slide() - -func update_animation(direction): - if is_jumping: - animated_sprite_2d.play("jump") - elif direction != 0: - animated_sprite_2d.flip_h = (direction < 0) - animated_sprite_2d.play("run") - else: - animated_sprite_2d.play("idle") - diff --git a/player.tscn b/player.tscn deleted file mode 100644 index 3840e9d..0000000 --- a/player.tscn +++ /dev/null @@ -1,70 +0,0 @@ -[gd_scene load_steps=10 format=3 uid="uid://c5njgaps6d3vn"] - -[ext_resource type="Texture2D" uid="uid://bbaks8lekbw53" path="res://sprites/bazzabogan.png" id="1_6kthl"] -[ext_resource type="Script" path="res://player.gd" id="1_y8jpy"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_l3wuf"] -atlas = ExtResource("1_6kthl") -region = Rect2(0, 0, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_nm0eg"] -atlas = ExtResource("1_6kthl") -region = Rect2(128, 0, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_uadt3"] -atlas = ExtResource("1_6kthl") -region = Rect2(32, 0, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_ewher"] -atlas = ExtResource("1_6kthl") -region = Rect2(64, 0, 32, 32) - -[sub_resource type="AtlasTexture" id="AtlasTexture_gctgy"] -atlas = ExtResource("1_6kthl") -region = Rect2(96, 0, 32, 32) - -[sub_resource type="SpriteFrames" id="SpriteFrames_bl6kg"] -animations = [{ -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_l3wuf") -}], -"loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_nm0eg") -}], -"loop": true, -"name": &"jump", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": SubResource("AtlasTexture_uadt3") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_ewher") -}, { -"duration": 1.0, -"texture": SubResource("AtlasTexture_gctgy") -}], -"loop": true, -"name": &"run", -"speed": 12.0 -}] - -[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_vmep3"] -height = 32.0 - -[node name="player" type="CharacterBody2D"] -script = ExtResource("1_y8jpy") - -[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] -sprite_frames = SubResource("SpriteFrames_bl6kg") -animation = &"run" - -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] -shape = SubResource("CapsuleShape2D_vmep3") diff --git a/project.godot b/project.godot index 9e333de..8a0c9cb 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="SuperMathio" -run/main_scene="res://world.tscn" +run/main_scene="res://intro.tscn" config/features=PackedStringArray("4.2", "GL Compatibility") config/icon="res://icon.svg" @@ -19,4 +19,4 @@ config/icon="res://icon.svg" renderer/rendering_method="gl_compatibility" renderer/rendering_method.mobile="gl_compatibility" -environment/defaults/default_clear_color=Color(0.560784, 0.835294, 1, 1) +environment/defaults/default_clear_color=Color(0.0235294, 0.0235294, 0.0235294, 1) diff --git a/sprites/Tileset.png b/sprites/Tileset.png new file mode 100644 index 0000000..d0d40aa Binary files /dev/null and b/sprites/Tileset.png differ diff --git a/sprites/Tileset.png.import b/sprites/Tileset.png.import new file mode 100644 index 0000000..f7731c7 --- /dev/null +++ b/sprites/Tileset.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://s7xmd65hltuh" +path="res://.godot/imported/Tileset.png-a8ffc1a35ac4cb02efe4276169135695.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/Tileset.png" +dest_files=["res://.godot/imported/Tileset.png-a8ffc1a35ac4cb02efe4276169135695.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 diff --git a/world.tscn b/world.tscn deleted file mode 100644 index b354296..0000000 --- a/world.tscn +++ /dev/null @@ -1,50 +0,0 @@ -[gd_scene load_steps=9 format=3 uid="uid://d25dmlkpt468c"] - -[ext_resource type="Texture2D" uid="uid://07it5xehcx0" path="res://sprites/block.png" id="1_x4yy8"] -[ext_resource type="Texture2D" uid="uid://wifmfna0xx26" path="res://sprites/brick.png" id="2_h3orb"] -[ext_resource type="Texture2D" uid="uid://c1tmjlqe4qmi0" path="res://sprites/diagonal_brick.png" id="3_0wjxw"] -[ext_resource type="PackedScene" uid="uid://c5njgaps6d3vn" path="res://player.tscn" id="3_b84gf"] - -[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_brspi"] -resource_name = "block" -texture = ExtResource("1_x4yy8") -0:0/0 = 0 -0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) -0:0/0/physics_layer_0/angular_velocity = 0.0 -0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) - -[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_5rxdw"] -resource_name = "brick" -texture = ExtResource("2_h3orb") -0:0/0 = 0 -0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) -0:0/0/physics_layer_0/angular_velocity = 0.0 -0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8) - -[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_twci4"] -texture = ExtResource("3_0wjxw") -0:0/0 = 0 -0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0) -0:0/0/physics_layer_0/angular_velocity = 0.0 -0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 8, 8, 8, 8, -8) - -[sub_resource type="TileSet" id="TileSet_pv314"] -physics_layer_0/collision_layer = 1 -sources/0 = SubResource("TileSetAtlasSource_brspi") -sources/1 = SubResource("TileSetAtlasSource_5rxdw") -sources/2 = SubResource("TileSetAtlasSource_twci4") - -[node name="world" type="Node2D"] - -[node name="TileMap" type="TileMap" parent="."] -tile_set = SubResource("TileSet_pv314") -format = 2 -layer_0/tile_data = PackedInt32Array(2490368, 1, 0, 2555904, 1, 0, 2621440, 1, 0, 2490369, 1, 0, 2555905, 1, 0, 2621441, 1, 0, 2490370, 1, 0, 2555906, 1, 0, 2621442, 1, 0, 2490371, 1, 0, 2555907, 1, 0, 2621443, 1, 0, 2490372, 1, 0, 2555908, 1, 0, 2621444, 1, 0, 2490373, 1, 0, 2555909, 1, 0, 2621445, 1, 0, 2490374, 1, 0, 2555910, 1, 0, 2621446, 1, 0, 2490375, 1, 0, 2555911, 1, 0, 2621447, 1, 0, 2490376, 1, 0, 2555912, 1, 0, 2621448, 1, 0, 2490377, 1, 0, 2555913, 1, 0, 2621449, 1, 0, 2490378, 1, 0, 2555914, 1, 0, 2621450, 1, 0, 2490379, 1, 0, 2555915, 1, 0, 2621451, 1, 0, 2490380, 1, 0, 2555916, 1, 0, 2621452, 1, 0, 2490381, 1, 0, 2555917, 1, 0, 2621453, 1, 0, 2490382, 1, 0, 2555918, 1, 0, 2621454, 1, 0, 2490383, 1, 0, 2555919, 1, 0, 2621455, 1, 0, 2490384, 1, 0, 2555920, 1, 0, 2621456, 1, 0, 2490385, 1, 0, 2555921, 1, 0, 2621457, 1, 0, 2490386, 1, 0, 2555922, 1, 0, 2621458, 1, 0, 2490387, 1, 0, 2555923, 1, 0, 2621459, 1, 0, 2490388, 1, 0, 2555924, 1, 0, 2621460, 1, 0, 2490389, 1, 0, 2555925, 1, 0, 2621461, 1, 0, 2490390, 1, 0, 2555926, 1, 0, 2621462, 1, 0, 2490391, 1, 0, 2555927, 1, 0, 2621463, 1, 0, 2490392, 1, 0, 2555928, 1, 0, 2621464, 1, 0, 2490393, 1, 0, 2555929, 1, 0, 2621465, 1, 0, 2490394, 1, 0, 2555930, 1, 0, 2621466, 1, 0, 2490395, 1, 0, 2555931, 1, 0, 2621467, 1, 0, 2490396, 1, 0, 2555932, 1, 0, 2621468, 1, 0, 2490397, 1, 0, 2555933, 1, 0, 2621469, 1, 0, 2490398, 1, 0, 2555934, 1, 0, 2621470, 1, 0, 2490399, 1, 0, 2555935, 1, 0, 2621471, 1, 0, 2490400, 1, 0, 2555936, 1, 0, 2621472, 1, 0, 2490401, 1, 0, 2555937, 1, 0, 2621473, 1, 0, 2490402, 1, 0, 2555938, 1, 0, 2621474, 1, 0, 2490403, 1, 0, 2555939, 1, 0, 2621475, 1, 0, 2490404, 1, 0, 2555940, 1, 0, 2621476, 1, 0, 2490405, 1, 0, 2555941, 1, 0, 2621477, 1, 0, 2490406, 1, 0, 2555942, 1, 0, 2621478, 1, 0, 2490407, 1, 0, 2555943, 1, 0, 2621479, 1, 0, 2490408, 1, 0, 2555944, 1, 0, 2621480, 1, 0, 2490409, 1, 0, 2555945, 1, 0, 2621481, 1, 0, 2490410, 1, 0, 2555946, 1, 0, 2621482, 1, 0, 2490411, 1, 0, 2555947, 1, 0, 2621483, 1, 0, 2490412, 1, 0, 2555948, 1, 0, 2621484, 1, 0, 2490413, 1, 0, 2555949, 1, 0, 2621485, 1, 0, 2490414, 1, 0, 2555950, 1, 0, 2621486, 1, 0, 2490415, 1, 0, 2555951, 1, 0, 2621487, 1, 0, 2490416, 1, 0, 2555952, 1, 0, 2621488, 1, 0, 2490417, 1, 0, 2555953, 1, 0, 2621489, 1, 0, 2490418, 1, 0, 2555954, 1, 0, 2621490, 1, 0, 2490419, 1, 0, 2555955, 1, 0, 2621491, 1, 0, 2490420, 1, 0, 2555956, 1, 0, 2621492, 1, 0, 2490421, 1, 0, 2555957, 1, 0, 2621493, 1, 0, 2490422, 1, 0, 2555958, 1, 0, 2621494, 1, 0, 2490423, 1, 0, 2555959, 1, 0, 2621495, 1, 0, 2490424, 1, 0, 2555960, 1, 0, 2621496, 1, 0, 2490425, 1, 0, 2555961, 1, 0, 2621497, 1, 0, 2490426, 1, 0, 2555962, 1, 0, 2621498, 1, 0, 2490427, 1, 0, 2555963, 1, 0, 2621499, 1, 0, 2490428, 1, 0, 2555964, 1, 0, 2621500, 1, 0, 2490429, 1, 0, 2555965, 1, 0, 2621501, 1, 0, 2490430, 1, 0, 2555966, 1, 0, 2621502, 1, 0, 2490431, 1, 0, 2555967, 1, 0, 2621503, 1, 0, 2490432, 1, 0, 2555968, 1, 0, 2621504, 1, 0, 2490433, 1, 0, 2555969, 1, 0, 2621505, 1, 0, 2490434, 1, 0, 2555970, 1, 0, 2621506, 1, 0, 2490435, 1, 0, 2555971, 1, 0, 2621507, 1, 0, 2490436, 1, 0, 2555972, 1, 0, 2621508, 1, 0, 2490437, 1, 0, 2555973, 1, 0, 2621509, 1, 0, 2490438, 1, 0, 2555974, 1, 0, 2621510, 1, 0, 2490439, 1, 0, 2555975, 1, 0, 2621511, 1, 0, 2424863, 0, 0, 2424864, 0, 0, 1966119, 1, 0, 2031655, 1, 0, 2097191, 1, 0, 2162727, 1, 0, 2228263, 1, 0, 2293799, 1, 0, 2359335, 1, 0, 2424871, 1, 0, 1966120, 1, 0, 2031656, 1, 0, 2097192, 1, 0, 2162728, 1, 0, 2228264, 1, 0, 2293800, 1, 0, 2359336, 1, 0, 2424872, 1, 0, 1966121, 1, 0, 2031657, 1, 0, 2097193, 1, 0, 2162729, 1, 0, 2228265, 1, 0, 2293801, 1, 0, 2359337, 1, 0, 2424873, 1, 0, 2424869, 1, 0, 2359334, 1, 0, 2293798, 2, 0, 2359333, 2, 0, 2424868, 2, 0, 2424870, 1, 0) - -[node name="player" parent="TileMap" instance=ExtResource("3_b84gf")] -position = Vector2(67, 521) - -[node name="Camera2D" type="Camera2D" parent="TileMap/player"] -limit_left = 0 -limit_top = 0 -limit_bottom = 650