From 3f58cc49214b131d1483c014f99fb4e7eca76aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C4=83zvan=20C=2E=20R=C4=83dulescu?= Date: Tue, 4 Feb 2020 12:10:07 +0200 Subject: [PATCH] Finish look and feel of the toy demos Based on the 2D Beginner Project look, these demos now have the colorful GDQuest "theme" to them. This had the effect of removing the circle and triangle/ship sprites as everything is drawn in Godot directly. --- project/assets/sprites/large_circle.png | Bin 2345 -> 0 bytes .../assets/sprites/large_circle.png.import | 34 -------------- project/assets/sprites/small_circle.png | Bin 1918 -> 0 bytes .../assets/sprites/small_circle.png.import | 34 -------------- project/assets/sprites/triangle.png | Bin 2752 -> 0 bytes project/assets/sprites/triangle.png.import | 34 -------------- .../demos/PursueSeek/PursueVSSeekDemo.tscn | 43 ++++++++++++------ project/demos/Quickstart/Bullet.tscn | 11 ++--- project/demos/Quickstart/QuickStartDemo.tscn | 34 ++++++++++---- project/demos/Utils/Line2DDraw.gd | 14 ++++++ 10 files changed, 74 insertions(+), 130 deletions(-) delete mode 100644 project/assets/sprites/large_circle.png delete mode 100644 project/assets/sprites/large_circle.png.import delete mode 100644 project/assets/sprites/small_circle.png delete mode 100644 project/assets/sprites/small_circle.png.import delete mode 100644 project/assets/sprites/triangle.png delete mode 100644 project/assets/sprites/triangle.png.import create mode 100644 project/demos/Utils/Line2DDraw.gd diff --git a/project/assets/sprites/large_circle.png b/project/assets/sprites/large_circle.png deleted file mode 100644 index e69cc1136fbcf0d2212cc72a7c558f88d58869d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2345 zcmcImc~BEq9A2;pf~hEq$I!a2bwp*^BO%FdjRcYis6oMamA2E(?gkc;Y?|GefZ74H zWxPh~RTYoXqLreI)@oa2T0B~Bt%Z8@K&w=%9XzX2wYF~|q)w+=|LM-W-M9O`_x--# zvA=n<$7N@zqWeWd5Twe=H0Oe+Q5jL4!Tm$w%_i{Z;>nyMK~PMbGQyyhtNK7t#9qNR zS)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eQfc#-e z*{h``<-!a1j%|f!yPiHVzo%nl;Fr_mRhP$ZR*xQC9q;ySFS!!H*3DO)rB`2_BG=W{ zY(L>`cp^Sq=l}8e%;?L{-I%^BJb&^2jiJqvccxw}Ut3lnP3H{!9{sv_rl|ObUAYCj zw9nrD!Wi7J??T&qPc`iQcGt#*V?P&lZVU7sy2F>wHh60yjd%ai Ri`~{2GEiIZo7lFy|8LTpfx-X) diff --git a/project/assets/sprites/small_circle.png.import b/project/assets/sprites/small_circle.png.import deleted file mode 100644 index 560c875..0000000 --- a/project/assets/sprites/small_circle.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/small_circle.png-e9ef462acf0465fde3767e7b0877ff44.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/sprites/small_circle.png" -dest_files=[ "res://.import/small_circle.png-e9ef462acf0465fde3767e7b0877ff44.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=true -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/project/assets/sprites/triangle.png b/project/assets/sprites/triangle.png deleted file mode 100644 index 5d8b0262cfc7bf42ed1968428fc5c3000aafd7a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2752 zcmcImdsGuw9=<_DAXN1C;z}8USNY zYvYqFN%94llG1Z=f>My&Y`u|20}wJN+lVXENeiSP)mnp;-S@XfHl!t_>_nj)ksBjO zjW#ORL@v%<7_ZDtS4s%>oY_!FHbxWZNed2T>vaY*mMvuu@?!Mdxec?SL5L+?$_{fH zgp%a3Py}TnAt6`9QKAAKB$jYd5hCFUf*>A(ieW?yqkIm6Vu%RiOQ7M4OaosG%&BSw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Fwh)dvK-K`a2ORL6~`+KU&YVMyZ zZyFCN+9!EEO-^}vdXbMQ1by75aYbS@h4-ujPi7hNax_oQ+@9L+&lY~vpknx|{pL*U zjt{*Z&ng>tzc+Xs5?b{KpC@^ndW&w}3aRB!+XrT?Sv|AwP-l)KxC6T<-@GER0&Kg} yjr|aIJAVJZD;GX?a7q(qBh~32g{Z;HL!VJ+3!-9cik~_EF{2|F%BsTC^8W)CH42FU diff --git a/project/assets/sprites/triangle.png.import b/project/assets/sprites/triangle.png.import deleted file mode 100644 index e63a133..0000000 --- a/project/assets/sprites/triangle.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/triangle.png-fa05d9e46946b626c9973edf66af1138.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://assets/sprites/triangle.png" -dest_files=[ "res://.import/triangle.png-fa05d9e46946b626c9973edf66af1138.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=true -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/project/demos/PursueSeek/PursueVSSeekDemo.tscn b/project/demos/PursueSeek/PursueVSSeekDemo.tscn index 3086e09..a8049bd 100644 --- a/project/demos/PursueSeek/PursueVSSeekDemo.tscn +++ b/project/demos/PursueSeek/PursueVSSeekDemo.tscn @@ -5,7 +5,7 @@ [ext_resource path="res://demos/PursueSeek/BoundaryManager.gd" type="Script" id=3] [ext_resource path="res://demos/PursueSeek/PursueVSSeekDemo.gd" type="Script" id=4] [ext_resource path="res://assets/theme/gdquest.theme" type="Theme" id=5] -[ext_resource path="res://assets/sprites/triangle.png" type="Texture" id=6] +[ext_resource path="res://demos/Utils/Line2DDraw.gd" type="Script" id=6] [ext_resource path="res://assets/sprites/background.png" type="Texture" id=7] [node name="PursueVSSeekDemo" type="Node2D"] @@ -38,9 +38,14 @@ side_thruster_strength = 20.0 [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="BoundaryManager/Player"] polygon = PoolVector2Array( 0, -32, -24, 32, 24, 32 ) -[node name="Sprite" type="Sprite" parent="BoundaryManager/Player"] -modulate = Color( 0.968627, 0.188235, 0.0352941, 1 ) -texture = ExtResource( 6 ) +[node name="Line2D" type="Line2D" parent="BoundaryManager/Player"] +points = PoolVector2Array( 0, 32, 24, 32, 0, -32, -24, 32, 0, 32 ) +width = 8.0 +default_color = Color( 0.560784, 0.870588, 0.364706, 1 ) +joint_mode = 2 +antialiased = true +script = ExtResource( 6 ) +inner_color = Color( 0.235294, 0.639216, 0.439216, 1 ) [node name="Pursuer" type="KinematicBody2D" parent="BoundaryManager"] position = Vector2( 980, 550 ) @@ -50,9 +55,14 @@ script = ExtResource( 1 ) [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="BoundaryManager/Pursuer"] polygon = PoolVector2Array( 0, -32, -24, 32, 24, 32 ) -[node name="Sprite" type="Sprite" parent="BoundaryManager/Pursuer"] -modulate = Color( 1, 0.937255, 0.0235294, 1 ) -texture = ExtResource( 6 ) +[node name="Line2D" type="Line2D" parent="BoundaryManager/Pursuer"] +points = PoolVector2Array( 0, 32, 24, 32, 0, -32, -24, 32, 0, 32 ) +width = 8.0 +default_color = Color( 1, 0.709804, 0.439216, 1 ) +joint_mode = 2 +antialiased = true +script = ExtResource( 6 ) +inner_color = Color( 0.890196, 0.411765, 0.337255, 1 ) [node name="Seeker" type="KinematicBody2D" parent="BoundaryManager"] position = Vector2( 980, 150 ) @@ -64,9 +74,14 @@ use_seek = true [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="BoundaryManager/Seeker"] polygon = PoolVector2Array( 0, -32, -24, 32, 24, 32 ) -[node name="Sprite" type="Sprite" parent="BoundaryManager/Seeker"] -modulate = Color( 0.278431, 0.815686, 0.14902, 1 ) -texture = ExtResource( 6 ) +[node name="Line2D" type="Line2D" parent="BoundaryManager/Seeker"] +points = PoolVector2Array( 0, 32, 24, 32, 0, -32, -24, 32, 0, 32 ) +width = 8.0 +default_color = Color( 0.301961, 0.65098, 1, 1 ) +joint_mode = 2 +antialiased = true +script = ExtResource( 6 ) +inner_color = Color( 0.294118, 0.356863, 0.670588, 1 ) [node name="GUI" type="PanelContainer" parent="."] margin_right = 1024.0 @@ -88,9 +103,9 @@ margin_bottom = 100.0 rect_min_size = Vector2( 0, 84 ) bbcode_enabled = true bbcode_text = "Pursue vs. Seek Demo -Move the player around with WASD and notice the [color=yellow]yellow Pursuer[/color] and the [color=lime]green Seeker[/color] follow -the [color=red]red \"Ship\"[/color] around" +Move the player around with WASD and notice the [color=#ffb570]orange Pursuer[/color] and the [color=aqua]blue Seeker[/color] follow +the [color=lime]green \"Ship\"[/color] around" text = "Pursue vs. Seek Demo -Move the player around with WASD and notice the yellow Pursuer and the green Seeker follow -the red \"Ship\" around" +Move the player around with WASD and notice the orange Pursuer and the blue Seeker follow +the green \"Ship\" around" scroll_active = false diff --git a/project/demos/Quickstart/Bullet.tscn b/project/demos/Quickstart/Bullet.tscn index d3b4a89..7f6d9b4 100644 --- a/project/demos/Quickstart/Bullet.tscn +++ b/project/demos/Quickstart/Bullet.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://assets/sprites/small_circle.png" type="Texture" id=1] +[ext_resource path="res://demos/Utils/CircleDraw.gd" type="Script" id=1] [ext_resource path="res://demos/Quickstart/Bullet.gd" type="Script" id=2] [sub_resource type="CircleShape2D" id=1] @@ -13,11 +13,10 @@ script = ExtResource( 2 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource( 1 ) - -[node name="Sprite" type="Sprite" parent="."] -modulate = Color( 0.141176, 0.188235, 0.901961, 1 ) -scale = Vector2( 0.25, 0.25 ) -texture = ExtResource( 1 ) +script = ExtResource( 1 ) +inner_color = Color( 0.235294, 0.639216, 0.439216, 1 ) +outer_color = Color( 0.560784, 0.870588, 0.364706, 1 ) +stroke = 2.0 [node name="Lifetime" type="Timer" parent="."] process_mode = 0 diff --git a/project/demos/Quickstart/QuickStartDemo.tscn b/project/demos/Quickstart/QuickStartDemo.tscn index 13f70bf..86a73a5 100644 --- a/project/demos/Quickstart/QuickStartDemo.tscn +++ b/project/demos/Quickstart/QuickStartDemo.tscn @@ -1,12 +1,20 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=6 format=2] -[ext_resource path="res://assets/sprites/triangle.png" type="Texture" id=1] +[ext_resource path="res://demos/Utils/Line2DDraw.gd" type="Script" id=1] [ext_resource path="res://demos/Quickstart/Agent.gd" type="Script" id=2] [ext_resource path="res://demos/Quickstart/Player.gd" type="Script" id=3] [ext_resource path="res://demos/Quickstart/Bullet.tscn" type="PackedScene" id=4] +[ext_resource path="res://assets/sprites/background.png" type="Texture" id=5] [node name="QuickStartDemo" type="Node2D"] +[node name="BackgroudLayer" type="CanvasLayer" parent="."] +layer = -1 + +[node name="Background" type="Sprite" parent="BackgroudLayer"] +texture = ExtResource( 5 ) +centered = false + [node name="Player" type="KinematicBody2D" parent="." groups=[ "Player", ]] @@ -19,9 +27,14 @@ bullet = ExtResource( 4 ) [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Player"] polygon = PoolVector2Array( 0, -32, -24, 32, 24, 32 ) -[node name="Sprite" type="Sprite" parent="Player"] -modulate = Color( 0.968627, 0.188235, 0.0352941, 1 ) -texture = ExtResource( 1 ) +[node name="Line2D" type="Line2D" parent="Player"] +points = PoolVector2Array( 0, 32, 24, 32, 0, -32, -24, 32, 0, 32 ) +width = 8.0 +default_color = Color( 0.560784, 0.870588, 0.364706, 1 ) +joint_mode = 2 +antialiased = true +script = ExtResource( 1 ) +inner_color = Color( 0.235294, 0.639216, 0.439216, 1 ) [node name="Agent" type="KinematicBody2D" parent="."] position = Vector2( 807.798, 141.773 ) @@ -33,8 +46,13 @@ script = ExtResource( 2 ) [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Agent"] polygon = PoolVector2Array( 0, -32, -24, 32, 24, 32 ) -[node name="Sprite" type="Sprite" parent="Agent"] -modulate = Color( 0.478431, 0.87451, 0.0784314, 1 ) -texture = ExtResource( 1 ) +[node name="Line2D" type="Line2D" parent="Agent"] +points = PoolVector2Array( 0, 32, 24, 32, 0, -32, -24, 32, 0, 32 ) +width = 8.0 +default_color = Color( 1, 0.709804, 0.439216, 1 ) +joint_mode = 2 +antialiased = true +script = ExtResource( 1 ) +inner_color = Color( 0.890196, 0.411765, 0.337255, 1 ) [node name="Bullets" type="Node2D" parent="."] diff --git a/project/demos/Utils/Line2DDraw.gd b/project/demos/Utils/Line2DDraw.gd new file mode 100644 index 0000000..4dcc666 --- /dev/null +++ b/project/demos/Utils/Line2DDraw.gd @@ -0,0 +1,14 @@ +tool +extends Line2D + + +export(Color) var inner_color := Color() setget set_inner_color + + +func _draw() -> void: + draw_colored_polygon(points, inner_color) + + +func set_inner_color(val: Color) -> void: + inner_color = val + update()