commit 21399f904fbebb41660397502908358b5637af57 Author: Felipe M Date: Thu Jan 21 22:43:08 2021 +0100 Game #1: Rocket Launch diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..37f05f2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.import diff --git a/README.md b/README.md new file mode 100644 index 0000000..b5a0986 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# 1-bit Godot Course Games diff --git a/rocket-launch/Sprites/LaunchButton.png b/rocket-launch/Sprites/LaunchButton.png new file mode 100644 index 0000000..34c5f4d Binary files /dev/null and b/rocket-launch/Sprites/LaunchButton.png differ diff --git a/rocket-launch/Sprites/LaunchButton.png.import b/rocket-launch/Sprites/LaunchButton.png.import new file mode 100644 index 0000000..df981e6 --- /dev/null +++ b/rocket-launch/Sprites/LaunchButton.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/LaunchButton.png-690088af9c8a78f3675ee51acac93688.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Sprites/LaunchButton.png" +dest_files=[ "res://.import/LaunchButton.png-690088af9c8a78f3675ee51acac93688.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=false +svg/scale=1.0 diff --git a/rocket-launch/Sprites/RocketShip.png b/rocket-launch/Sprites/RocketShip.png new file mode 100644 index 0000000..baa57dd Binary files /dev/null and b/rocket-launch/Sprites/RocketShip.png differ diff --git a/rocket-launch/Sprites/RocketShip.png.import b/rocket-launch/Sprites/RocketShip.png.import new file mode 100644 index 0000000..efdbd4d --- /dev/null +++ b/rocket-launch/Sprites/RocketShip.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/RocketShip.png-f01deddafa175472a11201f8d040be3b.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Sprites/RocketShip.png" +dest_files=[ "res://.import/RocketShip.png-f01deddafa175472a11201f8d040be3b.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=false +svg/scale=1.0 diff --git a/rocket-launch/Sprites/RocketShipLaunch.png b/rocket-launch/Sprites/RocketShipLaunch.png new file mode 100644 index 0000000..827964a Binary files /dev/null and b/rocket-launch/Sprites/RocketShipLaunch.png differ diff --git a/rocket-launch/Sprites/RocketShipLaunch.png.import b/rocket-launch/Sprites/RocketShipLaunch.png.import new file mode 100644 index 0000000..698b92e --- /dev/null +++ b/rocket-launch/Sprites/RocketShipLaunch.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/RocketShipLaunch.png-9029da898b5dd283fd9581293d901e48.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Sprites/RocketShipLaunch.png" +dest_files=[ "res://.import/RocketShipLaunch.png-9029da898b5dd283fd9581293d901e48.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=false +svg/scale=1.0 diff --git a/rocket-launch/World.gd b/rocket-launch/World.gd new file mode 100644 index 0000000..28fb3a2 --- /dev/null +++ b/rocket-launch/World.gd @@ -0,0 +1,8 @@ +extends Node + +onready var animationPlayer: = $AnimationPlayer +onready var rocketship: = $RocketShip + +func _on_LaunchButton_pressed(): + rocketship.texture = load("res://Sprites/RocketShipLaunch.png") + animationPlayer.play("Launch") diff --git a/rocket-launch/World.tscn b/rocket-launch/World.tscn new file mode 100644 index 0000000..38ec7b4 --- /dev/null +++ b/rocket-launch/World.tscn @@ -0,0 +1,61 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://Sprites/RocketShip.png" type="Texture" id=1] +[ext_resource path="res://World.gd" type="Script" id=2] +[ext_resource path="res://Sprites/LaunchButton.png" type="Texture" id=3] + +[sub_resource type="GDScript" id=1] +script/source = "extends Sprite + + +func _ready(): + print(\"Hello world\") + +" + +[sub_resource type="Animation" id=2] +resource_name = "Launch" +tracks/0/type = "value" +tracks/0/path = NodePath("RocketShip:position") +tracks/0/interp = 2 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector2( 640, 620 ), Vector2( 640, -130 ) ] +} + +[node name="World" type="Node"] +script = ExtResource( 2 ) + +[node name="ColorRect" type="ColorRect" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +color = Color( 0, 0, 0, 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="RocketShip" type="Sprite" parent="."] +position = Vector2( 640, 620 ) +scale = Vector2( 2, 2 ) +texture = ExtResource( 1 ) +script = SubResource( 1 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/Launch = SubResource( 2 ) + +[node name="LaunchButton" type="TextureButton" parent="."] +margin_left = 1168.0 +margin_top = 672.0 +margin_right = 1216.0 +margin_bottom = 688.0 +rect_scale = Vector2( 2, 2 ) +texture_normal = ExtResource( 3 ) +__meta__ = { +"_edit_use_anchors_": false +} +[connection signal="pressed" from="LaunchButton" to="." method="_on_LaunchButton_pressed"] diff --git a/rocket-launch/default_env.tres b/rocket-launch/default_env.tres new file mode 100644 index 0000000..20207a4 --- /dev/null +++ b/rocket-launch/default_env.tres @@ -0,0 +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/rocket-launch/icon.png b/rocket-launch/icon.png new file mode 100644 index 0000000..c98fbb6 Binary files /dev/null and b/rocket-launch/icon.png differ diff --git a/rocket-launch/icon.png.import b/rocket-launch/icon.png.import new file mode 100644 index 0000000..c16cdba --- /dev/null +++ b/rocket-launch/icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.png" +dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.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=false +svg/scale=1.0 diff --git a/rocket-launch/project.godot b/rocket-launch/project.godot new file mode 100644 index 0000000..f3f67d2 --- /dev/null +++ b/rocket-launch/project.godot @@ -0,0 +1,53 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=4 + +_global_script_classes=[ ] +_global_script_class_icons={ + +} + +[application] + +config/name="Rocker Launch" +run/main_scene="res://World.tscn" +config/icon="res://icon.png" + +[display] + +window/size/width=1280 +window/size/height=720 +window/size/resizable=false + +[importer_defaults] + +texture={ +"compress/bptc_ldr": 0, +"compress/hdr_mode": 0, +"compress/lossy_quality": 0.7, +"compress/mode": 0, +"compress/normal_map": 0, +"detect_3d": false, +"flags/anisotropic": false, +"flags/filter": false, +"flags/mipmaps": false, +"flags/repeat": 0, +"flags/srgb": 2, +"process/HDR_as_SRGB": false, +"process/fix_alpha_border": true, +"process/invert_color": false, +"process/premult_alpha": false, +"size_limit": 0, +"stream": false, +"svg/scale": 1.0 +} + +[rendering] + +environment/default_environment="res://default_env.tres"