From be38b244b79f964ef08e95cceef8a5c69f29e606 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Wed, 4 Nov 2020 15:30:27 -0600 Subject: [PATCH] Improve visuals Improved the look of the label that shows the number of coins --- Game Scenes/Game.tscn | 52 +++++++++++++++++++++++++++++++----- Objects/Coin.tscn | 4 +-- {Objects => Scripts}/Coin.gd | 0 3 files changed, 48 insertions(+), 8 deletions(-) rename {Objects => Scripts}/Coin.gd (100%) diff --git a/Game Scenes/Game.tscn b/Game Scenes/Game.tscn index e0a95ca..ed99352 100644 --- a/Game Scenes/Game.tscn +++ b/Game Scenes/Game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=14 format=2] [ext_resource path="res://Objects/Rocket.tscn" type="PackedScene" id=1] [ext_resource path="res://Scripts/Rocket.gd" type="Script" id=2] @@ -6,6 +6,40 @@ [ext_resource path="res://Scripts/Game.gd" type="Script" id=4] [ext_resource path="res://Scripts/Score.gd" type="Script" id=5] [ext_resource path="res://Scripts/CoinLabel.gd" type="Script" id=6] +[ext_resource path="res://Images and Anims/In Game/coin.png" type="Texture" id=7] + +[sub_resource type="AtlasTexture" id=1] +flags = 4 +atlas = ExtResource( 7 ) +region = Rect2( 0, 0, 16, 16 ) + +[sub_resource type="AtlasTexture" id=2] +flags = 4 +atlas = ExtResource( 7 ) +region = Rect2( 16, 0, 16, 16 ) + +[sub_resource type="AtlasTexture" id=3] +flags = 4 +atlas = ExtResource( 7 ) +region = Rect2( 32, 0, 16, 16 ) + +[sub_resource type="AtlasTexture" id=4] +flags = 4 +atlas = ExtResource( 7 ) +region = Rect2( 48, 0, 16, 16 ) + +[sub_resource type="AtlasTexture" id=5] +flags = 4 +atlas = ExtResource( 7 ) +region = Rect2( 64, 0, 16, 16 ) + +[sub_resource type="SpriteFrames" id=6] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ], +"loop": true, +"name": "default", +"speed": 10.0 +} ] [node name="Game" type="Node2D"] script = ExtResource( 4 ) @@ -16,11 +50,10 @@ scale = Vector2( 2, 2 ) script = ExtResource( 2 ) [node name="Coins" type="Label" parent="Rocket"] -margin_left = -41.9442 -margin_top = -56.8347 -margin_right = 42.0558 -margin_bottom = -41.8347 -align = 1 +margin_left = -3.92264 +margin_top = -41.2194 +margin_right = 49.0774 +margin_bottom = -27.2194 valign = 1 script = ExtResource( 6 ) __meta__ = { @@ -42,6 +75,13 @@ __meta__ = { "_edit_use_anchors_": false } +[node name="CoinAnim" type="AnimatedSprite" parent="Rocket"] +position = Vector2( -8.0022, -34.2137 ) +scale = Vector2( 0.401688, 0.401688 ) +frames = SubResource( 6 ) +frame = 4 +playing = true + [node name="ParallaxBackground" type="ParallaxBackground" parent="."] [node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"] diff --git a/Objects/Coin.tscn b/Objects/Coin.tscn index 04f05bc..818070d 100644 --- a/Objects/Coin.tscn +++ b/Objects/Coin.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=10 format=2] [ext_resource path="res://Images and Anims/In Game/coin.png" type="Texture" id=1] -[ext_resource path="res://Objects/Coin.gd" type="Script" id=2] +[ext_resource path="res://Scripts/Coin.gd" type="Script" id=2] [sub_resource type="CircleShape2D" id=1] radius = 22.2384 @@ -49,6 +49,6 @@ shape = SubResource( 1 ) scale = Vector2( 2, 2 ) frames = SubResource( 7 ) animation = "Spin" -frame = 2 +frame = 4 playing = true [connection signal="body_entered" from="." to="." method="_on_Coin_body_entered"] diff --git a/Objects/Coin.gd b/Scripts/Coin.gd similarity index 100% rename from Objects/Coin.gd rename to Scripts/Coin.gd