From 60d38726ad60c320d58734d4e3c836f4a6d87d01 Mon Sep 17 00:00:00 2001 From: Adrian Pegler Date: Tue, 9 Jul 2024 14:54:00 +0200 Subject: [PATCH] Restart the Project with cooler and more versatile tileset Signed-off-by: Adrian Pegler --- intro.tscn | 87 +++++++++++++++++++++++++++++++++++++ player.gd | 44 ------------------- player.tscn | 70 ----------------------------- project.godot | 4 +- sprites/Tileset.png | Bin 0 -> 4730 bytes sprites/Tileset.png.import | 34 +++++++++++++++ world.tscn | 50 --------------------- 7 files changed, 123 insertions(+), 166 deletions(-) create mode 100644 intro.tscn delete mode 100644 player.gd delete mode 100644 player.tscn create mode 100644 sprites/Tileset.png create mode 100644 sprites/Tileset.png.import delete mode 100644 world.tscn 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 0000000000000000000000000000000000000000..d0d40aa72573cf6088ad845b637755a017996e01 GIT binary patch literal 4730 zcmV-=5{2!FP)005u}1^@s6i_d2*0004mX+uL$Nkc;* zaB^>EX>4Tx04R}tkv&MmKpe$iQ>9ue4t5Yx$xxl_q9Tr^ibb$c+6t{Ym|XfHG-*gu zTpR`0f`cE6RR4rtTPCT<| z>74h8!>lYR#OK5l23?T&k?XR{Z=6dG3p_JyWYcrRVPdh=!Ey()vY`@B6Gs$PqkJLf zvch?bvs$UK);;+PLj`R)!*!a&NMI33q#!~@4I8MyLX=jG6ccIMk9+us9Dj;jGPyRu z$T5#9R7j2={11M2YZj*_-K0<)=zg*7k1-&y3pDGt{e5iP%@e@?3|wh#f3*S3ev)2q zYmpeSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{01#41L_t(|+U=d|j^nryg%2g!-R{}V1-ZOJg1kiDJb8|N zg&+tv$jFKd$>eHzrMIJibIlT8C7IzEhoV(}e7j_9O z?itmJ&gG}}d`h}8Vt1#hW<<~u?d1V9?QsV1R|D`iz6qYEUJbrW0=`w1Eo)RjPRF%S!nXv3dl;tC zhFQ3?!O9mp9JSIurho&LkZZ!Ts0(8d?g>CG?FJ~dk%QGiSgp9R8Ny2sgf;fjGj?Lg zr4&jB>VRAxp-rk4!-q&sC?QOx;w=xku=+Jr?`g`n+IR#7>4j9@k3%v7v(P9%WM4gd^eeq8g_k(IUXLix18)-BY7viIu=MEQLDp+*9#2ZBz*rw!L^bvQ;F|7#K*uZQ{G)dOD? z-*apUKrhm9Bhv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