├── .gitattributes ├── .gitignore ├── Catapult ├── Game │ ├── Background │ │ ├── Background.tscn │ │ ├── CloudParticles.tres │ │ ├── MoonLight.tres │ │ ├── MountainReflect.tres │ │ ├── ReflectTexture.shader │ │ ├── Stars.tres │ │ ├── cloud-particle.png │ │ ├── cloud-particle.png.import │ │ ├── moon-lastframe.png │ │ ├── moon-lastframe.png.import │ │ ├── moon.png │ │ ├── moon.png.import │ │ ├── mountain-left.png │ │ ├── mountain-left.png.import │ │ ├── mountain-right.png │ │ ├── mountain-right.png.import │ │ ├── star-particles.png │ │ └── star-particles.png.import │ ├── EndAnimation │ │ ├── EndAnimation.gd │ │ └── EndAnimation.tscn │ ├── ForeGround │ │ ├── ground.png │ │ └── ground.png.import │ ├── GUI │ │ ├── MilkInfo.gd │ │ ├── MilkInfo.tscn │ │ ├── MoneyLabel.gd │ │ ├── Shop.gd │ │ ├── Shop.tscn │ │ ├── ShopPanel.gd │ │ ├── Theme.tres │ │ ├── UpgradeNode.gd │ │ ├── UpgradeNode.tscn │ │ ├── audio-off.png │ │ ├── audio-off.png.import │ │ ├── audio-on.png │ │ ├── audio-on.png.import │ │ ├── back-arrow.png │ │ ├── back-arrow.png.import │ │ ├── fish1.png │ │ ├── fish1.png.import │ │ ├── fish2.png │ │ ├── fish2.png.import │ │ ├── fish3.png │ │ ├── fish3.png.import │ │ ├── fish4.png │ │ ├── fish4.png.import │ │ ├── milk-indicator-fill.png │ │ ├── milk-indicator-fill.png.import │ │ ├── milk-indicator-under.png │ │ ├── milk-indicator-under.png.import │ │ ├── milk-preview-fill.png │ │ ├── milk-preview-fill.png.import │ │ ├── mixkit-video-game-mystery-alert-234.wav │ │ ├── mixkit-video-game-mystery-alert-234.wav.import │ │ ├── mousebutton.png │ │ ├── mousebutton.png.import │ │ ├── music-off.png │ │ ├── music-off.png.import │ │ ├── music-on.png │ │ ├── music-on.png.import │ │ ├── upgrade-checked.png │ │ ├── upgrade-checked.png.import │ │ ├── upgrade-unchecked.png │ │ └── upgrade-unchecked.png.import │ ├── Game.gd │ ├── Game.tscn │ ├── Upgrades │ │ ├── UnlockedUpgrades.gd │ │ └── UnlockedUpgrades.tscn │ ├── World │ │ ├── BounceLineDrawer.gd │ │ ├── Camera2D.gd │ │ ├── Catapult │ │ │ ├── Catapult.gd │ │ │ ├── Catapult.tscn │ │ │ ├── holder.png │ │ │ ├── holder.png.import │ │ │ ├── slingshot.png │ │ │ └── slingshot.png.import │ │ ├── Cats │ │ │ ├── Cat.gd │ │ │ ├── Cat.tscn │ │ │ ├── Cat.tscn.tmp │ │ │ ├── Olin │ │ │ │ └── Olin.tscn │ │ │ ├── Outline.shader │ │ │ ├── cat-animation-launch.png │ │ │ ├── cat-animation-launch.png.import │ │ │ ├── cat-animation.png │ │ │ ├── cat-animation.png.import │ │ │ ├── cat-drinking.png │ │ │ ├── cat-drinking.png.import │ │ │ ├── cat-seated.png │ │ │ ├── cat-seated.png.import │ │ │ ├── cat.png │ │ │ ├── cat.png.import │ │ │ ├── dangling.png │ │ │ ├── dangling.png.import │ │ │ ├── launch-particles.png │ │ │ ├── launch-particles.png.import │ │ │ ├── walking.png │ │ │ └── walking.png.import │ │ ├── StuffSpawner │ │ │ ├── LaunchStuffSpawner.gd │ │ │ ├── LaunchStuffSpawner.tscn │ │ │ └── Stuff │ │ │ │ ├── BaseStuff.gd │ │ │ │ ├── BaseStuff.tscn │ │ │ │ ├── Booster │ │ │ │ ├── Booster.gd │ │ │ │ ├── Booster.tscn │ │ │ │ ├── booster.png │ │ │ │ ├── booster.png.import │ │ │ │ ├── booster.wav │ │ │ │ ├── booster.wav.import │ │ │ │ ├── launch.wav │ │ │ │ └── launch.wav.import │ │ │ │ ├── Brick │ │ │ │ ├── Brick.gd │ │ │ │ ├── Brick.tscn │ │ │ │ ├── brick.png │ │ │ │ ├── brick.png.import │ │ │ │ ├── mixkit-electronic-retro-block-hit-2185.wav │ │ │ │ └── mixkit-electronic-retro-block-hit-2185.wav.import │ │ │ │ ├── Bumper │ │ │ │ ├── Bumper.gd │ │ │ │ ├── Bumper.tscn │ │ │ │ ├── bumper-activate.png │ │ │ │ ├── bumper-activate.png.import │ │ │ │ ├── bumper-animation.png │ │ │ │ └── bumper-animation.png.import │ │ │ │ ├── Clouds │ │ │ │ ├── Cloud.gd │ │ │ │ ├── Cloud.tscn │ │ │ │ ├── cloud.png │ │ │ │ ├── cloud.png.import │ │ │ │ ├── cloud_hit.wav │ │ │ │ └── cloud_hit.wav.import │ │ │ │ ├── MilkBowl │ │ │ │ ├── MilkBowl.gd │ │ │ │ ├── MilkBowl.tscn │ │ │ │ ├── milk-bowl.png │ │ │ │ ├── milk-bowl.png.import │ │ │ │ ├── mixkit-unlock-game-notification-253.wav │ │ │ │ └── mixkit-unlock-game-notification-253.wav.import │ │ │ │ └── MoneyFish │ │ │ │ ├── MoneyFish.gd │ │ │ │ ├── MoneyFish.tscn │ │ │ │ ├── fish1.wav │ │ │ │ ├── fish1.wav.import │ │ │ │ ├── fish2.wav │ │ │ │ ├── fish2.wav.import │ │ │ │ ├── fish3.wav │ │ │ │ └── fish3.wav.import │ │ ├── Trampoline │ │ │ ├── Trampoline.gd │ │ │ ├── Trampoline.tscn │ │ │ ├── wobble1.wav │ │ │ ├── wobble1.wav.import │ │ │ ├── wobble2.wav │ │ │ └── wobble2.wav.import │ │ ├── World.gd │ │ ├── World.tscn │ │ ├── mixkit-arcade-retro-game-over-213.wav │ │ ├── mixkit-arcade-retro-game-over-213.wav.import │ │ ├── rat.png │ │ └── rat.png.import │ ├── calm.ogg │ ├── calm.ogg.import │ ├── launch.ogg │ └── launch.ogg.import ├── MouseControl │ ├── MouseControl.gd │ └── MouseControl.tscn ├── default_bus_layout.tres ├── default_env.tres ├── icon.png ├── icon.png.import ├── project.godot └── slkscre.ttf └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Godot-specific ignores 3 | .import/ 4 | .import 5 | export.cfg 6 | export_presets.cfg 7 | 8 | # Mono-specific ignores 9 | .mono/ 10 | data_*/ 11 | -------------------------------------------------------------------------------- /Catapult/Game/Background/Background.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=16 format=2] 2 | 3 | [ext_resource path="res://Game/Background/mountain-right.png" type="Texture" id=1] 4 | [ext_resource path="res://Game/Background/mountain-left.png" type="Texture" id=2] 5 | [ext_resource path="res://Game/Background/star-particles.png" type="Texture" id=3] 6 | [ext_resource path="res://Game/Background/moon.png" type="Texture" id=4] 7 | [ext_resource path="res://Game/Background/cloud-particle.png" type="Texture" id=5] 8 | [ext_resource path="res://Game/Background/MoonLight.tres" type="Material" id=6] 9 | [ext_resource path="res://Game/Background/MountainReflect.tres" type="Material" id=7] 10 | [ext_resource path="res://Game/Background/CloudParticles.tres" type="Material" id=8] 11 | [ext_resource path="res://Game/Background/Stars.tres" type="Material" id=9] 12 | 13 | [sub_resource type="CanvasItemMaterial" id=1] 14 | particles_animation = true 15 | particles_anim_h_frames = 9 16 | particles_anim_v_frames = 1 17 | particles_anim_loop = false 18 | 19 | [sub_resource type="CanvasItemMaterial" id=5] 20 | particles_animation = true 21 | particles_anim_h_frames = 3 22 | particles_anim_v_frames = 1 23 | particles_anim_loop = false 24 | 25 | [sub_resource type="Shader" id=10] 26 | code = "shader_type canvas_item; 27 | render_mode blend_mix; 28 | 29 | uniform sampler2D tex; 30 | uniform vec2 texture_size = vec2(58.0, 29.0); 31 | 32 | uniform int OCTAVES : hint_range(0, 100, 1); 33 | uniform float SIZE : hint_range(0, 50); 34 | uniform float seed: hint_range(1, 10); 35 | 36 | float rand(vec2 coord) { 37 | return fract(sin(dot(coord, vec2(35, 62)) * 1000.0) * 1000.0 * seed); 38 | } 39 | 40 | float noise(vec2 coord){ 41 | vec2 i = floor(coord); 42 | vec2 f = fract(coord); 43 | 44 | // 4 corners of a rectangle surrounding our point 45 | float a = rand(i); 46 | float b = rand(i + vec2(1.0, 0.0)); 47 | float c = rand(i + vec2(0.0, 1.0)); 48 | float d = rand(i + vec2(1.0, 1.0)); 49 | 50 | vec2 cubic = f * f * (3.0 - 2.0 * f); 51 | 52 | return mix(a, b, cubic.x) + (c - a) * cubic.y * (1.0 - cubic.x) + (d - b) * cubic.x * cubic.y; 53 | } 54 | 55 | float fbm(vec2 coord){ 56 | float value = 0.0; 57 | float scale = 0.5; 58 | 59 | for(int i = 0; i < OCTAVES ; i++){ 60 | value += noise(coord) * scale; 61 | coord *= 2.0; 62 | scale *= 0.5; 63 | } 64 | return value; 65 | } 66 | 67 | void fragment() { 68 | vec2 uv = floor(UV * texture_size)/texture_size; 69 | vec4 col = texture(tex, vec2(UV.x, 1.0-uv.y)); 70 | float fbm = fbm((uv*SIZE) - vec2(TIME,0.0)*0.2); 71 | fbm *= (1.0 - uv.y); 72 | // fbm *= (0.5 - abs(uv.x-0.5))*0.5; 73 | // 74 | col.a *= step(1.0, mod(UV.y * texture_size.y, 2.0)); 75 | col.a *= step(0.3, fbm); 76 | 77 | COLOR = col; 78 | }" 79 | custom_defines = "" 80 | 81 | [sub_resource type="ShaderMaterial" id=12] 82 | shader = SubResource( 10 ) 83 | shader_param/texture_size = Vector2( 19, 23 ) 84 | shader_param/OCTAVES = 3 85 | shader_param/SIZE = 12.0 86 | shader_param/seed = 1.031 87 | shader_param/tex = ExtResource( 1 ) 88 | 89 | [sub_resource type="Shader" id=13] 90 | code = "shader_type canvas_item; 91 | render_mode blend_mix; 92 | 93 | void fragment() { 94 | vec4 col = vec4(1.0); 95 | col.r = texture(SCREEN_TEXTURE, SCREEN_UV + vec2(0.002, 0.0)).r; 96 | col.g = texture(SCREEN_TEXTURE, SCREEN_UV).g; 97 | col.b = texture(SCREEN_TEXTURE, SCREEN_UV - vec2(0.002, 0.0)).b; 98 | 99 | COLOR = col; 100 | 101 | }" 102 | custom_defines = "" 103 | 104 | [sub_resource type="ShaderMaterial" id=14] 105 | shader = SubResource( 13 ) 106 | 107 | [node name="Control" type="Control"] 108 | anchor_right = 1.0 109 | anchor_bottom = 1.0 110 | mouse_filter = 2 111 | __meta__ = { 112 | "_edit_use_anchors_": false 113 | } 114 | 115 | [node name="BackgroundColor" type="ColorRect" parent="."] 116 | anchor_right = 1.0 117 | anchor_bottom = 1.0 118 | mouse_filter = 2 119 | color = Color( 0.152941, 0.152941, 0.266667, 1 ) 120 | __meta__ = { 121 | "_edit_use_anchors_": false 122 | } 123 | 124 | [node name="Stars" type="Particles2D" parent="."] 125 | visible = false 126 | material = SubResource( 1 ) 127 | position = Vector2( 50, 55 ) 128 | amount = 10 129 | lifetime = 30.0 130 | preprocess = 30.0 131 | process_material = ExtResource( 9 ) 132 | texture = ExtResource( 3 ) 133 | 134 | [node name="Clouds" type="Particles2D" parent="."] 135 | visible = false 136 | material = SubResource( 5 ) 137 | position = Vector2( -40, 75 ) 138 | amount = 10 139 | lifetime = 60.0 140 | preprocess = 60.0 141 | visibility_rect = Rect2( -100, -100, 400, 200 ) 142 | process_material = ExtResource( 8 ) 143 | texture = ExtResource( 5 ) 144 | 145 | [node name="mountain-right" type="Sprite" parent="."] 146 | visible = false 147 | position = Vector2( 81, 99 ) 148 | texture = ExtResource( 1 ) 149 | centered = false 150 | 151 | [node name="mountain-left" type="Sprite" parent="."] 152 | visible = false 153 | position = Vector2( 0, 89 ) 154 | texture = ExtResource( 2 ) 155 | centered = false 156 | 157 | [node name="Sea" type="ColorRect" parent="."] 158 | visible = false 159 | anchor_right = 1.0 160 | anchor_bottom = 1.0 161 | margin_top = 121.0 162 | mouse_filter = 2 163 | color = Color( 0.286275, 0.301961, 0.494118, 1 ) 164 | __meta__ = { 165 | "_edit_use_anchors_": false 166 | } 167 | 168 | [node name="Sea2" type="ColorRect" parent="."] 169 | visible = false 170 | anchor_right = 1.0 171 | anchor_bottom = 1.0 172 | margin_left = 20.0 173 | margin_top = 121.0 174 | margin_right = -20.0 175 | margin_bottom = -28.0 176 | mouse_filter = 2 177 | color = Color( 0.984314, 0.960784, 0.937255, 1 ) 178 | __meta__ = { 179 | "_edit_use_anchors_": false 180 | } 181 | 182 | [node name="MoonShader" type="ColorRect" parent="."] 183 | visible = false 184 | material = ExtResource( 6 ) 185 | anchor_right = 1.0 186 | anchor_bottom = 1.0 187 | margin_left = 46.0 188 | margin_top = 122.0 189 | margin_right = -19.0 190 | margin_bottom = 1.0 191 | mouse_filter = 2 192 | color = Color( 0.286275, 0.301961, 0.494118, 1 ) 193 | __meta__ = { 194 | "_edit_use_anchors_": false 195 | } 196 | 197 | [node name="MountainReflect" type="ColorRect" parent="."] 198 | visible = false 199 | material = ExtResource( 7 ) 200 | anchor_right = 1.0 201 | anchor_bottom = 1.0 202 | margin_top = 121.0 203 | margin_right = -81.0 204 | margin_bottom = 3.0 205 | mouse_filter = 2 206 | color = Color( 0.286275, 0.301961, 0.494118, 1 ) 207 | __meta__ = { 208 | "_edit_use_anchors_": false 209 | } 210 | 211 | [node name="MountainReflect2" type="ColorRect" parent="."] 212 | visible = false 213 | material = SubResource( 12 ) 214 | anchor_right = 1.0 215 | anchor_bottom = 1.0 216 | margin_left = 81.0 217 | margin_top = 121.0 218 | margin_bottom = -6.0 219 | mouse_filter = 2 220 | color = Color( 0.286275, 0.301961, 0.494118, 1 ) 221 | __meta__ = { 222 | "_edit_use_anchors_": false 223 | } 224 | 225 | [node name="moon" type="Sprite" parent="."] 226 | position = Vector2( 56, 30 ) 227 | texture = ExtResource( 4 ) 228 | centered = false 229 | 230 | [node name="ColorRect3" type="ColorRect" parent="."] 231 | visible = false 232 | material = SubResource( 14 ) 233 | anchor_right = 1.0 234 | anchor_bottom = 1.0 235 | mouse_filter = 2 236 | __meta__ = { 237 | "_edit_use_anchors_": false 238 | } 239 | -------------------------------------------------------------------------------- /Catapult/Game/Background/CloudParticles.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=2 format=2] 2 | 3 | [sub_resource type="Shader" id=1] 4 | code = "shader_type particles; 5 | uniform vec3 direction; 6 | uniform float spread; 7 | uniform float flatness; 8 | uniform float initial_linear_velocity; 9 | uniform float initial_angle; 10 | uniform float angular_velocity; 11 | uniform float orbit_velocity; 12 | uniform float linear_accel; 13 | uniform float radial_accel; 14 | uniform float tangent_accel; 15 | uniform float damping; 16 | uniform float scale; 17 | uniform float hue_variation; 18 | uniform float anim_speed; 19 | uniform float anim_offset; 20 | uniform float initial_linear_velocity_random; 21 | uniform float initial_angle_random; 22 | uniform float angular_velocity_random; 23 | uniform float orbit_velocity_random; 24 | uniform float linear_accel_random; 25 | uniform float radial_accel_random; 26 | uniform float tangent_accel_random; 27 | uniform float damping_random; 28 | uniform float scale_random; 29 | uniform float hue_variation_random; 30 | uniform float anim_speed_random; 31 | uniform float anim_offset_random; 32 | uniform float lifetime_randomness; 33 | uniform vec3 emission_box_extents; 34 | uniform vec4 color_value : hint_color; 35 | uniform int trail_divisor; 36 | uniform vec3 gravity; 37 | uniform sampler2D color_ramp; 38 | 39 | 40 | float rand_from_seed(inout uint seed) { 41 | int k; 42 | int s = int(seed); 43 | if (s == 0) 44 | s = 305420679; 45 | k = s / 127773; 46 | s = 16807 * (s - k * 127773) - 2836 * k; 47 | if (s < 0) 48 | s += 2147483647; 49 | seed = uint(s); 50 | return float(seed % uint(65536)) / 65535.0; 51 | } 52 | 53 | float rand_from_seed_m1_p1(inout uint seed) { 54 | return rand_from_seed(seed) * 2.0 - 1.0; 55 | } 56 | 57 | uint hash(uint x) { 58 | x = ((x >> uint(16)) ^ x) * uint(73244475); 59 | x = ((x >> uint(16)) ^ x) * uint(73244475); 60 | x = (x >> uint(16)) ^ x; 61 | return x; 62 | } 63 | 64 | void vertex() { 65 | uint base_number = NUMBER / uint(trail_divisor); 66 | uint alt_seed = hash(base_number + uint(1) + RANDOM_SEED); 67 | float angle_rand = rand_from_seed(alt_seed); 68 | float scale_rand = rand_from_seed(alt_seed); 69 | float hue_rot_rand = rand_from_seed(alt_seed); 70 | float anim_offset_rand = rand_from_seed(alt_seed); 71 | float pi = 3.14159; 72 | float degree_to_rad = pi / 180.0; 73 | 74 | bool restart = false; 75 | if (CUSTOM.y > CUSTOM.w) { 76 | restart = true; 77 | } 78 | 79 | if (RESTART || restart) { 80 | float tex_linear_velocity = 0.0; 81 | float tex_angle = 0.0; 82 | float tex_anim_offset = 0.0; 83 | float spread_rad = spread * degree_to_rad; 84 | float angle1_rad = rand_from_seed_m1_p1(alt_seed) * spread_rad; 85 | angle1_rad += direction.x != 0.0 ? atan(direction.y, direction.x) : sign(direction.y) * (pi / 2.0); 86 | vec3 rot = vec3(cos(angle1_rad), sin(angle1_rad), 0.0); 87 | VELOCITY = rot * initial_linear_velocity * mix(1.0, rand_from_seed(alt_seed), initial_linear_velocity_random); 88 | float base_angle = (initial_angle + tex_angle) * mix(1.0, angle_rand, initial_angle_random); 89 | CUSTOM.x = base_angle * degree_to_rad; 90 | CUSTOM.y = 0.0; 91 | CUSTOM.w = (1.0 - lifetime_randomness * rand_from_seed(alt_seed)); 92 | CUSTOM.z = (anim_offset + tex_anim_offset) * mix(1.0, anim_offset_rand, anim_offset_random); 93 | TRANSFORM[3].xyz = vec3(rand_from_seed(alt_seed) * 2.0 - 1.0, rand_from_seed(alt_seed) * 2.0 - 1.0, rand_from_seed(alt_seed) * 2.0 - 1.0) * emission_box_extents; 94 | VELOCITY = (EMISSION_TRANSFORM * vec4(VELOCITY, 0.0)).xyz; 95 | TRANSFORM = EMISSION_TRANSFORM * TRANSFORM; 96 | VELOCITY.z = 0.0; 97 | TRANSFORM[3].z = 0.0; 98 | } else { 99 | CUSTOM.y += DELTA / LIFETIME; 100 | float tex_linear_velocity = 0.0; 101 | float tex_orbit_velocity = 0.0; 102 | float tex_angular_velocity = 0.0; 103 | float tex_linear_accel = 0.0; 104 | float tex_radial_accel = 0.0; 105 | float tex_tangent_accel = 0.0; 106 | float tex_damping = 0.0; 107 | float tex_angle = 0.0; 108 | float tex_anim_speed = 0.0; 109 | float tex_anim_offset = 0.0; 110 | vec3 force = gravity; 111 | vec3 pos = TRANSFORM[3].xyz; 112 | pos.z = 0.0; 113 | // apply linear acceleration 114 | force += length(VELOCITY) > 0.0 ? normalize(VELOCITY) * (linear_accel + tex_linear_accel) * mix(1.0, rand_from_seed(alt_seed), linear_accel_random) : vec3(0.0); 115 | // apply radial acceleration 116 | vec3 org = EMISSION_TRANSFORM[3].xyz; 117 | vec3 diff = pos - org; 118 | force += length(diff) > 0.0 ? normalize(diff) * (radial_accel + tex_radial_accel) * mix(1.0, rand_from_seed(alt_seed), radial_accel_random) : vec3(0.0); 119 | // apply tangential acceleration; 120 | force += length(diff.yx) > 0.0 ? vec3(normalize(diff.yx * vec2(-1.0, 1.0)), 0.0) * ((tangent_accel + tex_tangent_accel) * mix(1.0, rand_from_seed(alt_seed), tangent_accel_random)) : vec3(0.0); 121 | // apply attractor forces 122 | //VELOCITY.y = sin(TIME + TRANSFORM[3].y*5.0)*2.0; 123 | VELOCITY += force * DELTA; 124 | TRANSFORM[3].y += sin(TIME + VELOCITY.x*10.0)*0.01; 125 | // orbit velocity 126 | float orbit_amount = (orbit_velocity + tex_orbit_velocity) * mix(1.0, rand_from_seed(alt_seed), orbit_velocity_random); 127 | if (orbit_amount != 0.0) { 128 | float ang = orbit_amount * DELTA * pi * 2.0; 129 | mat2 rot = mat2(vec2(cos(ang), -sin(ang)), vec2(sin(ang), cos(ang))); 130 | TRANSFORM[3].xy -= diff.xy; 131 | TRANSFORM[3].xy += rot * diff.xy; 132 | } 133 | if (damping + tex_damping > 0.0) { 134 | float v = length(VELOCITY); 135 | float damp = (damping + tex_damping) * mix(1.0, rand_from_seed(alt_seed), damping_random); 136 | v -= damp * DELTA; 137 | if (v < 0.0) { 138 | VELOCITY = vec3(0.0); 139 | } else { 140 | VELOCITY = normalize(VELOCITY) * v; 141 | } 142 | } 143 | float base_angle = (initial_angle + tex_angle) * mix(1.0, angle_rand, initial_angle_random); 144 | base_angle += CUSTOM.y * LIFETIME * (angular_velocity + tex_angular_velocity) * mix(1.0, rand_from_seed(alt_seed) * 2.0 - 1.0, angular_velocity_random); 145 | CUSTOM.x = base_angle * degree_to_rad; 146 | CUSTOM.z = (anim_offset + tex_anim_offset) * mix(1.0, anim_offset_rand, anim_offset_random) + CUSTOM.y * (anim_speed + tex_anim_speed) * mix(1.0, rand_from_seed(alt_seed), anim_speed_random); 147 | } 148 | float tex_scale = 1.0; 149 | float tex_hue_variation = 0.0; 150 | float hue_rot_angle = (hue_variation + tex_hue_variation) * pi * 2.0 * mix(1.0, hue_rot_rand * 2.0 - 1.0, hue_variation_random); 151 | float hue_rot_c = cos(hue_rot_angle); 152 | float hue_rot_s = sin(hue_rot_angle); 153 | mat4 hue_rot_mat = mat4(vec4(0.299, 0.587, 0.114, 0.0), 154 | vec4(0.299, 0.587, 0.114, 0.0), 155 | vec4(0.299, 0.587, 0.114, 0.0), 156 | vec4(0.000, 0.000, 0.000, 1.0)) + 157 | mat4(vec4(0.701, -0.587, -0.114, 0.0), 158 | vec4(-0.299, 0.413, -0.114, 0.0), 159 | vec4(-0.300, -0.588, 0.886, 0.0), 160 | vec4(0.000, 0.000, 0.000, 0.0)) * hue_rot_c + 161 | mat4(vec4(0.168, 0.330, -0.497, 0.0), 162 | vec4(-0.328, 0.035, 0.292, 0.0), 163 | vec4(1.250, -1.050, -0.203, 0.0), 164 | vec4(0.000, 0.000, 0.000, 0.0)) * hue_rot_s; 165 | COLOR = hue_rot_mat * textureLod(color_ramp, vec2(CUSTOM.y, 0.0), 0.0); 166 | 167 | TRANSFORM[0] = vec4(cos(CUSTOM.x), -sin(CUSTOM.x), 0.0, 0.0); 168 | TRANSFORM[1] = vec4(sin(CUSTOM.x), cos(CUSTOM.x), 0.0, 0.0); 169 | TRANSFORM[2] = vec4(0.0, 0.0, 1.0, 0.0); 170 | float base_scale = tex_scale * mix(scale, 1.0, scale_random * scale_rand); 171 | if (base_scale < 0.000001) { 172 | base_scale = 0.000001; 173 | } 174 | TRANSFORM[0].xyz *= base_scale; 175 | TRANSFORM[1].xyz *= base_scale; 176 | TRANSFORM[2].xyz *= base_scale; 177 | VELOCITY.z = 0.0; 178 | TRANSFORM[3].z = 0.0; 179 | if (CUSTOM.y > CUSTOM.w) { ACTIVE = false; 180 | } 181 | } 182 | 183 | " 184 | 185 | [resource] 186 | shader = SubResource( 1 ) 187 | shader_param/direction = Vector3( 1, 0, 0 ) 188 | shader_param/spread = 0.0 189 | shader_param/flatness = 0.0 190 | shader_param/initial_linear_velocity = 5.0 191 | shader_param/initial_angle = 0.0 192 | shader_param/angular_velocity = 0.0 193 | shader_param/orbit_velocity = 0.0 194 | shader_param/linear_accel = 0.0 195 | shader_param/radial_accel = 0.0 196 | shader_param/tangent_accel = 0.0 197 | shader_param/damping = 0.0 198 | shader_param/scale = 1.0 199 | shader_param/hue_variation = 0.0 200 | shader_param/anim_speed = 0.0 201 | shader_param/anim_offset = 1.0 202 | shader_param/initial_linear_velocity_random = 0.4 203 | shader_param/initial_angle_random = 0.0 204 | shader_param/angular_velocity_random = 0.0 205 | shader_param/orbit_velocity_random = 0.0 206 | shader_param/linear_accel_random = 0.0 207 | shader_param/radial_accel_random = 0.0 208 | shader_param/tangent_accel_random = 0.0 209 | shader_param/damping_random = 0.0 210 | shader_param/scale_random = 0.0 211 | shader_param/hue_variation_random = 0.0 212 | shader_param/anim_speed_random = 0.0 213 | shader_param/anim_offset_random = 1.0 214 | shader_param/lifetime_randomness = 0.0 215 | shader_param/emission_box_extents = Vector3( 0, 20, 1 ) 216 | shader_param/color_value = Color( 1, 1, 1, 1 ) 217 | shader_param/trail_divisor = 1 218 | shader_param/gravity = Vector3( 0, -1e-06, 0 ) 219 | -------------------------------------------------------------------------------- /Catapult/Game/Background/MoonLight.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=2 format=2] 2 | 3 | [sub_resource type="Shader" id=1] 4 | code = "shader_type canvas_item; 5 | render_mode blend_mix; 6 | 7 | uniform vec4 color : hint_color; 8 | uniform vec2 texture_size = vec2(58.0, 29.0); 9 | 10 | 11 | uniform float SIZE : hint_range(0, 50); 12 | 13 | float rand(vec2 coord) { 14 | return fract(sin(dot(coord, vec2(35, 62)) * 1000.0) * 1000.0); 15 | } 16 | 17 | float noise(vec2 coord){ 18 | vec2 i = floor(coord); 19 | vec2 f = fract(coord); 20 | 21 | float a = rand(i); 22 | float b = rand(i + vec2(1.0, 0.0)); 23 | float c = rand(i + vec2(0.0, 1.0)); 24 | float d = rand(i + vec2(1.0, 1.0)); 25 | 26 | vec2 cubic = f * f * (3.0 - 2.0 * f); 27 | 28 | return mix(a, b, cubic.x) + (c - a) * cubic.y * (1.0 - cubic.x) + (d - b) * cubic.x * cubic.y; 29 | } 30 | 31 | void fragment() { 32 | vec2 uv = floor(UV * texture_size)/texture_size; 33 | vec4 col = color; 34 | float n = noise((uv*SIZE) - vec2(TIME,0.0)*0.4); 35 | n *= (1.5 - uv.y)*4.5; 36 | n *= (0.5 - abs(uv.x-0.5))*0.45; 37 | 38 | col.a *= step(1.0, mod(UV.y * texture_size.y, 2.0)); 39 | col.a *= step(0.45, n); 40 | 41 | COLOR = col; 42 | }" 43 | 44 | [resource] 45 | shader = SubResource( 1 ) 46 | shader_param/color = Color( 0.984314, 0.960784, 0.937255, 1 ) 47 | shader_param/texture_size = Vector2( 35, 29 ) 48 | shader_param/SIZE = 9.714 49 | -------------------------------------------------------------------------------- /Catapult/Game/Background/MountainReflect.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Game/Background/ReflectTexture.shader" type="Shader" id=1] 4 | 5 | [resource] 6 | shader = ExtResource( 1 ) 7 | shader_param/NOISE_SIZE = 12.714 8 | -------------------------------------------------------------------------------- /Catapult/Game/Background/ReflectTexture.shader: -------------------------------------------------------------------------------- 1 | shader_type canvas_item; 2 | render_mode blend_mix; 3 | 4 | uniform float noiseSize : hint_range(0, 50) = 15.0; 5 | uniform float speed : hint_range(-10.0, 10.0); 6 | uniform float albedo : hint_range(0.0, 1.0) = 0.7; 7 | 8 | float rand(vec2 coord) { 9 | return fract(sin(dot(coord, vec2(35, 62)) * 1000.0) * 1000.0); 10 | } 11 | 12 | float noise(vec2 coord){ 13 | vec2 i = floor(coord); 14 | vec2 f = fract(coord); 15 | 16 | float a = rand(i); 17 | float b = rand(i + vec2(1.0, 0.0)); 18 | float c = rand(i + vec2(0.0, 1.0)); 19 | float d = rand(i + vec2(1.0, 1.0)); 20 | 21 | vec2 cubic = f * f * (3.0 - 2.0 * f); 22 | 23 | return mix(a, b, cubic.x) + (c - a) * cubic.y * (1.0 - cubic.x) + (d - b) * cubic.x * cubic.y; 24 | } 25 | 26 | void fragment() { 27 | // get texture size in floats 28 | ivec2 ITexSize = textureSize(TEXTURE, 0); 29 | vec2 TSize = vec2(float(ITexSize.x), float(ITexSize.y)); 30 | 31 | // pixelize UV 32 | vec2 uv = floor(UV * TSize)/TSize; 33 | 34 | // read colors with y inversed, for mirror effect 35 | vec4 col = texture(TEXTURE, vec2(UV.x, 1.0-uv.y)); 36 | 37 | // make some noise 38 | float n = noise((uv*noiseSize) + vec2(TIME,0.0)*speed); 39 | 40 | // decrease noise value the lower down texture is. 41 | n *= (1.0 - uv.y); 42 | 43 | // remove noise value every 2nd pixel, creating an empty line 44 | col.a *= step(1.0, mod(UV.y * TSize.y, 2.0)); 45 | 46 | // set alpha to 0 or 1 47 | col.a *= step(1.0-albedo, n); 48 | 49 | COLOR = col; 50 | } -------------------------------------------------------------------------------- /Catapult/Game/Background/Stars.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ParticlesMaterial" load_steps=3 format=2] 2 | 3 | [sub_resource type="Gradient" id=1] 4 | offsets = PoolRealArray( 0, 0.0321543, 0.967846, 1 ) 5 | colors = PoolColorArray( 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 ) 6 | 7 | [sub_resource type="GradientTexture" id=2] 8 | gradient = SubResource( 1 ) 9 | 10 | [resource] 11 | emission_shape = 2 12 | emission_box_extents = Vector3( 50, 55, 1 ) 13 | flag_disable_z = true 14 | spread = 0.0 15 | gravity = Vector3( 0, 0, 0 ) 16 | initial_velocity_random = 0.4 17 | orbit_velocity = 0.0 18 | orbit_velocity_random = 0.0 19 | color_ramp = SubResource( 2 ) 20 | anim_offset = 1.0 21 | anim_offset_random = 1.0 22 | -------------------------------------------------------------------------------- /Catapult/Game/Background/cloud-particle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/Background/cloud-particle.png -------------------------------------------------------------------------------- /Catapult/Game/Background/cloud-particle.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/cloud-particle.png-6b3bf5a30ba723298e19f1461307e3af.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/Background/cloud-particle.png" 13 | dest_files=[ "res://.import/cloud-particle.png-6b3bf5a30ba723298e19f1461307e3af.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/Background/moon-lastframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/Background/moon-lastframe.png -------------------------------------------------------------------------------- /Catapult/Game/Background/moon-lastframe.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/moon-lastframe.png-351723e8642e48ae21cb61350545b47f.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/Background/moon-lastframe.png" 13 | dest_files=[ "res://.import/moon-lastframe.png-351723e8642e48ae21cb61350545b47f.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/Background/moon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/Background/moon.png -------------------------------------------------------------------------------- /Catapult/Game/Background/moon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/moon.png-cb94a4a84f3633ae3692b1480fbab860.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/Background/moon.png" 13 | dest_files=[ "res://.import/moon.png-cb94a4a84f3633ae3692b1480fbab860.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/Background/mountain-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/Background/mountain-left.png -------------------------------------------------------------------------------- /Catapult/Game/Background/mountain-left.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/mountain-left.png-6ca1b10e2c72e448f692a7873f277bfe.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/Background/mountain-left.png" 13 | dest_files=[ "res://.import/mountain-left.png-6ca1b10e2c72e448f692a7873f277bfe.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/Background/mountain-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/Background/mountain-right.png -------------------------------------------------------------------------------- /Catapult/Game/Background/mountain-right.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/mountain-right.png-8f6e7ab1128b498ea8c57dd9a029cbe0.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/Background/mountain-right.png" 13 | dest_files=[ "res://.import/mountain-right.png-8f6e7ab1128b498ea8c57dd9a029cbe0.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/Background/star-particles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/Background/star-particles.png -------------------------------------------------------------------------------- /Catapult/Game/Background/star-particles.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/star-particles.png-caa035e9fd300052bc85c4bbeec47f9e.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/Background/star-particles.png" 13 | dest_files=[ "res://.import/star-particles.png-caa035e9fd300052bc85c4bbeec47f9e.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/EndAnimation/EndAnimation.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | signal play_again 4 | 5 | func _ready(): 6 | $AnimationPlayer.play("default") 7 | 8 | func set_launches(amount): 9 | $ColorRect/LaunchText.text = String(amount) + " launches" 10 | 11 | 12 | func _on_Button_pressed(): 13 | emit_signal("play_again") 14 | -------------------------------------------------------------------------------- /Catapult/Game/EndAnimation/EndAnimation.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=17 format=2] 2 | 3 | [ext_resource path="res://Game/World/Cats/dangling.png" type="Texture" id=1] 4 | [ext_resource path="res://Game/World/Cats/Outline.shader" type="Shader" id=2] 5 | [ext_resource path="res://Game/Background/moon-lastframe.png" type="Texture" id=3] 6 | [ext_resource path="res://Game/EndAnimation/EndAnimation.gd" type="Script" id=4] 7 | [ext_resource path="res://Game/World/rat.png" type="Texture" id=5] 8 | [ext_resource path="res://Game/GUI/Theme.tres" type="Theme" id=6] 9 | [ext_resource path="res://slkscre.ttf" type="DynamicFontData" id=7] 10 | 11 | [sub_resource type="DynamicFont" id=1] 12 | size = 8 13 | extra_spacing_char = -2 14 | font_data = ExtResource( 7 ) 15 | 16 | [sub_resource type="ShaderMaterial" id=2] 17 | shader = ExtResource( 2 ) 18 | shader_param/outline_color = Color( 0.286275, 0.301961, 0.494118, 1 ) 19 | 20 | [sub_resource type="AtlasTexture" id=3] 21 | atlas = ExtResource( 1 ) 22 | region = Rect2( 0, 0, 16, 16 ) 23 | 24 | [sub_resource type="AtlasTexture" id=4] 25 | atlas = ExtResource( 1 ) 26 | region = Rect2( 16, 0, 16, 16 ) 27 | 28 | [sub_resource type="AtlasTexture" id=5] 29 | atlas = ExtResource( 1 ) 30 | region = Rect2( 32, 0, 16, 16 ) 31 | 32 | [sub_resource type="AtlasTexture" id=6] 33 | atlas = ExtResource( 1 ) 34 | region = Rect2( 48, 0, 16, 16 ) 35 | 36 | [sub_resource type="SpriteFrames" id=7] 37 | animations = [ { 38 | "frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ) ], 39 | "loop": true, 40 | "name": "default", 41 | "speed": 5.0 42 | } ] 43 | 44 | [sub_resource type="Animation" id=8] 45 | loop = true 46 | tracks/0/type = "value" 47 | tracks/0/path = NodePath("Cat:position") 48 | tracks/0/interp = 1 49 | tracks/0/loop_wrap = true 50 | tracks/0/imported = false 51 | tracks/0/enabled = true 52 | tracks/0/keys = { 53 | "times": PoolRealArray( 0, 0.5 ), 54 | "transitions": PoolRealArray( 1, 1 ), 55 | "update": 0, 56 | "values": [ Vector2( 52, 47 ), Vector2( 52, 38 ) ] 57 | } 58 | tracks/1/type = "value" 59 | tracks/1/path = NodePath("Sprite:position") 60 | tracks/1/interp = 1 61 | tracks/1/loop_wrap = true 62 | tracks/1/imported = false 63 | tracks/1/enabled = true 64 | tracks/1/keys = { 65 | "times": PoolRealArray( 0, 0.5 ), 66 | "transitions": PoolRealArray( 1, 1 ), 67 | "update": 0, 68 | "values": [ Vector2( 66, 48 ), Vector2( 66, 56 ) ] 69 | } 70 | tracks/2/type = "value" 71 | tracks/2/path = NodePath("Sprite2:position") 72 | tracks/2/interp = 1 73 | tracks/2/loop_wrap = true 74 | tracks/2/imported = false 75 | tracks/2/enabled = true 76 | tracks/2/keys = { 77 | "times": PoolRealArray( 0, 0.5 ), 78 | "transitions": PoolRealArray( 1, 1 ), 79 | "update": 0, 80 | "values": [ Vector2( 36, 48 ), Vector2( 36, 56 ) ] 81 | } 82 | 83 | [sub_resource type="ShaderMaterial" id=9] 84 | shader = ExtResource( 2 ) 85 | shader_param/outline_color = Color( 0.152941, 0.152941, 0.266667, 1 ) 86 | 87 | [node name="EndAnimation" type="Control"] 88 | anchor_right = 1.0 89 | anchor_bottom = 1.0 90 | script = ExtResource( 4 ) 91 | __meta__ = { 92 | "_edit_use_anchors_": false 93 | } 94 | 95 | [node name="ColorRect" type="ColorRect" parent="."] 96 | anchor_right = 1.0 97 | anchor_bottom = 1.0 98 | color = Color( 0.152941, 0.152941, 0.266667, 1 ) 99 | __meta__ = { 100 | "_edit_use_anchors_": false 101 | } 102 | 103 | [node name="TextureRect" type="TextureRect" parent="ColorRect"] 104 | margin_left = 25.0 105 | margin_top = 50.0 106 | margin_right = 75.0 107 | margin_bottom = 100.0 108 | rect_pivot_offset = Vector2( 25, 25 ) 109 | texture = ExtResource( 3 ) 110 | __meta__ = { 111 | "_edit_use_anchors_": false 112 | } 113 | 114 | [node name="Label" type="Label" parent="ColorRect"] 115 | margin_top = 110.0 116 | margin_right = 100.0 117 | margin_bottom = 127.0 118 | rect_min_size = Vector2( 100, 0 ) 119 | size_flags_horizontal = 3 120 | custom_fonts/font = SubResource( 1 ) 121 | text = "Thanks for playing" 122 | align = 1 123 | __meta__ = { 124 | "_edit_use_anchors_": false 125 | } 126 | 127 | [node name="Label2" type="Label" parent="ColorRect"] 128 | margin_top = 11.0 129 | margin_right = 100.0 130 | margin_bottom = 28.0 131 | rect_min_size = Vector2( 100, 0 ) 132 | size_flags_horizontal = 3 133 | custom_fonts/font = SubResource( 1 ) 134 | text = "Moon reached!" 135 | align = 1 136 | __meta__ = { 137 | "_edit_use_anchors_": false 138 | } 139 | 140 | [node name="LaunchText" type="Label" parent="ColorRect"] 141 | margin_top = 23.0 142 | margin_right = 100.0 143 | margin_bottom = 32.0 144 | rect_min_size = Vector2( 100, 0 ) 145 | size_flags_horizontal = 3 146 | custom_fonts/font = SubResource( 1 ) 147 | text = "x launches" 148 | align = 1 149 | __meta__ = { 150 | "_edit_use_anchors_": false 151 | } 152 | 153 | [node name="Button" type="Button" parent="ColorRect"] 154 | margin_left = 20.0 155 | margin_top = 129.0 156 | margin_right = 80.0 157 | margin_bottom = 139.0 158 | theme = ExtResource( 6 ) 159 | text = "play again?" 160 | __meta__ = { 161 | "_edit_use_anchors_": false 162 | } 163 | 164 | [node name="Cat" type="AnimatedSprite" parent="."] 165 | material = SubResource( 2 ) 166 | position = Vector2( 52, 47 ) 167 | frames = SubResource( 7 ) 168 | frame = 3 169 | playing = true 170 | 171 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 172 | anims/default = SubResource( 8 ) 173 | 174 | [node name="Sprite" type="Sprite" parent="."] 175 | material = SubResource( 9 ) 176 | position = Vector2( 66, 48 ) 177 | texture = ExtResource( 5 ) 178 | 179 | [node name="Sprite2" type="Sprite" parent="."] 180 | material = SubResource( 9 ) 181 | position = Vector2( 36, 48 ) 182 | texture = ExtResource( 5 ) 183 | [connection signal="pressed" from="ColorRect/Button" to="." method="_on_Button_pressed"] 184 | -------------------------------------------------------------------------------- /Catapult/Game/ForeGround/ground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/ForeGround/ground.png -------------------------------------------------------------------------------- /Catapult/Game/ForeGround/ground.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/ground.png-3b6804d78bcc3cf174695f149c937751.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/ForeGround/ground.png" 13 | dest_files=[ "res://.import/ground.png-3b6804d78bcc3cf174695f149c937751.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/MilkInfo.gd: -------------------------------------------------------------------------------- 1 | extends Control 2 | 3 | onready var texture_progress = $TextureProgress 4 | 5 | 6 | func _on_World_update_milk(m): 7 | texture_progress.value = m 8 | 9 | func _on_World_show_milk_bar(): 10 | visible = true 11 | 12 | func _on_World_hide_milk_bar(): 13 | visible = false 14 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/MilkInfo.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://Game/GUI/milk-indicator-under.png" type="Texture" id=1] 4 | [ext_resource path="res://Game/GUI/milk-indicator-fill.png" type="Texture" id=2] 5 | [ext_resource path="res://slkscre.ttf" type="DynamicFontData" id=3] 6 | [ext_resource path="res://Game/GUI/MilkInfo.gd" type="Script" id=4] 7 | 8 | [sub_resource type="DynamicFont" id=1] 9 | size = 8 10 | extra_spacing_top = -4 11 | font_data = ExtResource( 3 ) 12 | 13 | [node name="MilkInfo" type="Control"] 14 | margin_left = 3.0 15 | margin_top = 3.0 16 | margin_right = 43.0 17 | margin_bottom = 42.0 18 | script = ExtResource( 4 ) 19 | __meta__ = { 20 | "_edit_use_anchors_": false 21 | } 22 | 23 | [node name="TextureProgress" type="TextureProgress" parent="."] 24 | margin_right = 5.0 25 | margin_bottom = 29.0 26 | rect_min_size = Vector2( 5, 0 ) 27 | value = 100.0 28 | texture_under = ExtResource( 1 ) 29 | texture_progress = ExtResource( 2 ) 30 | fill_mode = 3 31 | nine_patch_stretch = true 32 | stretch_margin_left = 1 33 | stretch_margin_top = 1 34 | stretch_margin_right = 1 35 | stretch_margin_bottom = 1 36 | __meta__ = { 37 | "_edit_use_anchors_": false 38 | } 39 | 40 | [node name="Label" type="Label" parent="."] 41 | margin_left = 6.0 42 | margin_top = -6.0 43 | margin_right = 7.0 44 | margin_bottom = 39.0 45 | size_flags_vertical = 7 46 | custom_fonts/font = SubResource( 1 ) 47 | custom_colors/font_color = Color( 0.984314, 0.960784, 0.937255, 1 ) 48 | text = "Milk" 49 | autowrap = true 50 | __meta__ = { 51 | "_edit_use_anchors_": false 52 | } 53 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/MoneyLabel.gd: -------------------------------------------------------------------------------- 1 | extends Label 2 | 3 | 4 | func _ready(): 5 | get_tree().root.get_node("/root/UnlockedUpgrades").connect("change_money", self, "_on_change_money") 6 | 7 | func _on_change_money(m): 8 | text = String(m) 9 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/Shop.gd: -------------------------------------------------------------------------------- 1 | extends VBoxContainer 2 | 3 | signal close 4 | 5 | onready var upgrades = get_tree().root.get_node("/root/UnlockedUpgrades") 6 | onready var cats = $Row4/Cats 7 | onready var milkpower = $Row/MilkPower 8 | onready var milkspawn = $Row/MilkSpawn 9 | onready var moneyspawn = $Row2/FishSpawn 10 | onready var magnet = $Row2/Magnet 11 | onready var catapultsize = $Row3/CatapultSize 12 | onready var catapultpower = $Row3/CatapultPower 13 | onready var money = $HBoxContainer/MoneyLabel 14 | 15 | func _ready(): 16 | update_shop() 17 | 18 | func update_shop(): 19 | money.text = " x"+String(upgrades.get_money()) 20 | 21 | set_node_stats(cats, "cats") 22 | set_node_stats(milkpower, "trampoline_strength") 23 | set_node_stats(milkspawn, "milk_spawn_chance") 24 | set_node_stats(moneyspawn, "money_spawn_chance") 25 | set_node_stats(magnet, "magnet_strength") 26 | set_node_stats(catapultsize, "catapult_height") 27 | set_node_stats(catapultpower, "catapult_strength") 28 | 29 | func set_node_stats(node, upgr): 30 | node.set_unlocked_count(upgrades.get_unlocked_count(upgr)) 31 | node.set_can_buy(upgrades.can_unlock_next_upgrade(upgr)) 32 | var next = upgrades.get_next_upgrade(upgr) 33 | if next != null: 34 | node.set_price(next.price) 35 | else: 36 | node.set_price(0) 37 | node.set_upgrade_code(upgr) 38 | 39 | if !node.is_connected("pressed", self, "on_upgrade_pressed"): 40 | node.connect("pressed", self, "on_upgrade_pressed") 41 | 42 | func on_upgrade_pressed(upgr): 43 | upgrades.buy_upgrade(upgr) 44 | update_shop() 45 | 46 | 47 | func _on_BackButton_pressed(): 48 | emit_signal("close") 49 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/Shop.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=10 format=2] 2 | 3 | [ext_resource path="res://Game/GUI/UpgradeNode.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://Game/GUI/Shop.gd" type="Script" id=2] 5 | [ext_resource path="res://Game/GUI/fish4.png" type="Texture" id=3] 6 | [ext_resource path="res://Game/GUI/Theme.tres" type="Theme" id=4] 7 | [ext_resource path="res://Game/GUI/UpgradeNode.gd" type="Script" id=5] 8 | [ext_resource path="res://Game/GUI/upgrade-unchecked.png" type="Texture" id=6] 9 | [ext_resource path="res://Game/GUI/upgrade-checked.png" type="Texture" id=7] 10 | [ext_resource path="res://Game/GUI/back-arrow.png" type="Texture" id=8] 11 | 12 | [sub_resource type="StyleBoxFlat" id=1] 13 | bg_color = Color( 0.6, 0.6, 0.6, 0 ) 14 | 15 | [node name="Shop" type="VBoxContainer"] 16 | anchor_right = 1.0 17 | anchor_bottom = 1.0 18 | margin_left = 3.0 19 | margin_top = 3.0 20 | margin_right = -3.0 21 | margin_bottom = -3.0 22 | custom_constants/separation = 4 23 | script = ExtResource( 2 ) 24 | __meta__ = { 25 | "_edit_use_anchors_": false 26 | } 27 | 28 | [node name="HBoxContainer2" type="HBoxContainer" parent="."] 29 | margin_right = 94.0 30 | margin_bottom = 9.0 31 | 32 | [node name="BackButton" type="Button" parent="HBoxContainer2"] 33 | margin_right = 9.0 34 | margin_bottom = 9.0 35 | focus_mode = 0 36 | theme = ExtResource( 4 ) 37 | enabled_focus_mode = 0 38 | icon = ExtResource( 8 ) 39 | __meta__ = { 40 | "_edit_use_anchors_": false 41 | } 42 | 43 | [node name="Label" type="Label" parent="HBoxContainer2"] 44 | margin_left = 13.0 45 | margin_right = 94.0 46 | margin_bottom = 9.0 47 | size_flags_horizontal = 3 48 | theme = ExtResource( 4 ) 49 | text = "Shop" 50 | align = 1 51 | 52 | [node name="HBoxContainer" type="HBoxContainer" parent="."] 53 | margin_top = 13.0 54 | margin_right = 94.0 55 | margin_bottom = 22.0 56 | size_flags_horizontal = 3 57 | 58 | [node name="MoneyLabel" type="Label" parent="HBoxContainer"] 59 | margin_right = 94.0 60 | margin_bottom = 9.0 61 | size_flags_horizontal = 3 62 | theme = ExtResource( 4 ) 63 | text = " x500" 64 | 65 | [node name="TextureRect" type="TextureRect" parent="HBoxContainer/MoneyLabel"] 66 | margin_left = 3.0 67 | margin_top = 2.0 68 | margin_right = 10.0 69 | margin_bottom = 11.0 70 | texture = ExtResource( 3 ) 71 | __meta__ = { 72 | "_edit_use_anchors_": false 73 | } 74 | 75 | [node name="Row5" type="HBoxContainer" parent="."] 76 | margin_top = 26.0 77 | margin_right = 94.0 78 | margin_bottom = 36.0 79 | rect_min_size = Vector2( 0, 10 ) 80 | size_flags_horizontal = 3 81 | custom_constants/separation = 2 82 | 83 | [node name="Row4" type="HBoxContainer" parent="."] 84 | visible = false 85 | margin_top = 26.0 86 | margin_right = 94.0 87 | margin_bottom = 52.0 88 | size_flags_horizontal = 3 89 | size_flags_vertical = 3 90 | custom_constants/separation = 2 91 | 92 | [node name="Cats" type="VBoxContainer" parent="Row4"] 93 | margin_right = 94.0 94 | margin_bottom = 26.0 95 | size_flags_horizontal = 3 96 | size_flags_vertical = 3 97 | script = ExtResource( 5 ) 98 | __meta__ = { 99 | "_edit_use_anchors_": false 100 | } 101 | 102 | [node name="Panel" type="Panel" parent="Row4/Cats"] 103 | margin_right = 94.0 104 | margin_bottom = 26.0 105 | size_flags_horizontal = 3 106 | size_flags_vertical = 3 107 | theme = ExtResource( 4 ) 108 | 109 | [node name="Label" type="Label" parent="Row4/Cats/Panel"] 110 | margin_top = 1.0 111 | margin_right = 94.0 112 | margin_bottom = 8.0 113 | size_flags_horizontal = 3 114 | theme = ExtResource( 4 ) 115 | custom_styles/normal = SubResource( 1 ) 116 | custom_colors/font_color = Color( 0.152941, 0.152941, 0.266667, 1 ) 117 | text = "cats" 118 | align = 1 119 | __meta__ = { 120 | "_edit_use_anchors_": false 121 | } 122 | 123 | [node name="HBoxContainer" type="HBoxContainer" parent="Row4/Cats/Panel"] 124 | anchor_right = 1.0 125 | anchor_bottom = 1.0 126 | margin_top = 8.0 127 | margin_right = -1.0 128 | margin_bottom = -103.0 129 | size_flags_horizontal = 3 130 | size_flags_vertical = 3 131 | custom_constants/separation = 0 132 | __meta__ = { 133 | "_edit_use_anchors_": false 134 | } 135 | 136 | [node name="TextureRect" type="TextureRect" parent="Row4/Cats/Panel/HBoxContainer"] 137 | margin_right = 18.0 138 | margin_bottom = 6.0 139 | size_flags_horizontal = 3 140 | texture = ExtResource( 7 ) 141 | stretch_mode = 4 142 | 143 | [node name="TextureRect2" type="TextureRect" parent="Row4/Cats/Panel/HBoxContainer"] 144 | margin_left = 18.0 145 | margin_right = 37.0 146 | margin_bottom = 6.0 147 | size_flags_horizontal = 3 148 | texture = ExtResource( 6 ) 149 | stretch_mode = 4 150 | 151 | [node name="TextureRect3" type="TextureRect" parent="Row4/Cats/Panel/HBoxContainer"] 152 | margin_left = 37.0 153 | margin_right = 55.0 154 | margin_bottom = 6.0 155 | size_flags_horizontal = 3 156 | texture = ExtResource( 6 ) 157 | stretch_mode = 4 158 | 159 | [node name="TextureRect4" type="TextureRect" parent="Row4/Cats/Panel/HBoxContainer"] 160 | margin_left = 55.0 161 | margin_right = 74.0 162 | margin_bottom = 6.0 163 | size_flags_horizontal = 3 164 | texture = ExtResource( 6 ) 165 | stretch_mode = 4 166 | 167 | [node name="TextureRect5" type="TextureRect" parent="Row4/Cats/Panel/HBoxContainer"] 168 | margin_left = 74.0 169 | margin_right = 93.0 170 | margin_bottom = 6.0 171 | size_flags_horizontal = 3 172 | texture = ExtResource( 6 ) 173 | stretch_mode = 4 174 | 175 | [node name="Button" type="Button" parent="Row4/Cats/Panel"] 176 | anchor_right = 1.0 177 | anchor_bottom = 1.0 178 | margin_left = 3.0 179 | margin_top = 15.0 180 | margin_right = -3.0 181 | margin_bottom = -2.0 182 | focus_mode = 0 183 | theme = ExtResource( 4 ) 184 | enabled_focus_mode = 0 185 | text = "x500 " 186 | align = 2 187 | __meta__ = { 188 | "_edit_use_anchors_": false 189 | } 190 | 191 | [node name="TextureRect" type="TextureRect" parent="Row4/Cats/Panel/Button"] 192 | margin_left = 7.0 193 | margin_top = 2.0 194 | margin_right = 14.0 195 | margin_bottom = 7.0 196 | texture = ExtResource( 3 ) 197 | __meta__ = { 198 | "_edit_use_anchors_": false 199 | } 200 | 201 | [node name="Row" type="HBoxContainer" parent="."] 202 | margin_top = 40.0 203 | margin_right = 94.0 204 | margin_bottom = 67.0 205 | size_flags_horizontal = 3 206 | size_flags_vertical = 3 207 | custom_constants/separation = 2 208 | 209 | [node name="MilkPower" parent="Row" instance=ExtResource( 1 )] 210 | margin_right = 46.0 211 | margin_bottom = 27.0 212 | 213 | [node name="MilkSpawn" parent="Row" instance=ExtResource( 1 )] 214 | margin_left = 48.0 215 | margin_bottom = 27.0 216 | 217 | [node name="Panel" parent="Row/MilkSpawn" index="0"] 218 | margin_right = 46.0 219 | margin_bottom = 27.0 220 | 221 | [node name="Label" parent="Row/MilkSpawn/Panel" index="0"] 222 | margin_left = 2.0 223 | text = "milk spwn" 224 | 225 | [node name="TextureRect" parent="Row/MilkSpawn/Panel/HBoxContainer" index="0"] 226 | margin_right = 11.0 227 | margin_bottom = 6.0 228 | 229 | [node name="TextureRect2" parent="Row/MilkSpawn/Panel/HBoxContainer" index="1"] 230 | margin_left = 11.0 231 | margin_right = 22.0 232 | margin_bottom = 6.0 233 | 234 | [node name="TextureRect3" parent="Row/MilkSpawn/Panel/HBoxContainer" index="2"] 235 | margin_left = 22.0 236 | margin_right = 33.0 237 | margin_bottom = 6.0 238 | 239 | [node name="TextureRect4" parent="Row/MilkSpawn/Panel/HBoxContainer" index="3"] 240 | margin_left = 33.0 241 | margin_right = 45.0 242 | margin_bottom = 6.0 243 | 244 | [node name="Row2" type="HBoxContainer" parent="."] 245 | margin_top = 71.0 246 | margin_right = 94.0 247 | margin_bottom = 98.0 248 | size_flags_horizontal = 3 249 | size_flags_vertical = 3 250 | custom_constants/separation = 2 251 | 252 | [node name="Magnet" parent="Row2" instance=ExtResource( 1 )] 253 | margin_right = 46.0 254 | margin_bottom = 27.0 255 | 256 | [node name="Panel" parent="Row2/Magnet" index="0"] 257 | margin_right = 46.0 258 | margin_bottom = 27.0 259 | 260 | [node name="Label" parent="Row2/Magnet/Panel" index="0"] 261 | text = "magnet" 262 | 263 | [node name="TextureRect" parent="Row2/Magnet/Panel/HBoxContainer" index="0"] 264 | margin_right = 11.0 265 | margin_bottom = 6.0 266 | 267 | [node name="TextureRect2" parent="Row2/Magnet/Panel/HBoxContainer" index="1"] 268 | margin_left = 11.0 269 | margin_right = 22.0 270 | margin_bottom = 6.0 271 | 272 | [node name="TextureRect3" parent="Row2/Magnet/Panel/HBoxContainer" index="2"] 273 | margin_left = 22.0 274 | margin_right = 33.0 275 | margin_bottom = 6.0 276 | 277 | [node name="TextureRect4" parent="Row2/Magnet/Panel/HBoxContainer" index="3"] 278 | margin_left = 33.0 279 | margin_right = 45.0 280 | margin_bottom = 6.0 281 | 282 | [node name="FishSpawn" parent="Row2" instance=ExtResource( 1 )] 283 | margin_left = 48.0 284 | margin_bottom = 27.0 285 | 286 | [node name="Panel" parent="Row2/FishSpawn" index="0"] 287 | margin_right = 46.0 288 | margin_bottom = 27.0 289 | 290 | [node name="Label" parent="Row2/FishSpawn/Panel" index="0"] 291 | margin_left = 1.0 292 | text = "fish spwn" 293 | 294 | [node name="TextureRect" parent="Row2/FishSpawn/Panel/HBoxContainer" index="0"] 295 | margin_right = 11.0 296 | margin_bottom = 6.0 297 | 298 | [node name="TextureRect2" parent="Row2/FishSpawn/Panel/HBoxContainer" index="1"] 299 | margin_left = 11.0 300 | margin_right = 22.0 301 | margin_bottom = 6.0 302 | 303 | [node name="TextureRect3" parent="Row2/FishSpawn/Panel/HBoxContainer" index="2"] 304 | margin_left = 22.0 305 | margin_right = 33.0 306 | margin_bottom = 6.0 307 | 308 | [node name="TextureRect4" parent="Row2/FishSpawn/Panel/HBoxContainer" index="3"] 309 | margin_left = 33.0 310 | margin_right = 45.0 311 | margin_bottom = 6.0 312 | 313 | [node name="Button" parent="Row2/FishSpawn/Panel" index="2"] 314 | disabled = true 315 | 316 | [node name="Row3" type="HBoxContainer" parent="."] 317 | margin_top = 102.0 318 | margin_right = 94.0 319 | margin_bottom = 130.0 320 | size_flags_horizontal = 3 321 | size_flags_vertical = 3 322 | custom_constants/separation = 2 323 | 324 | [node name="CatapultSize" parent="Row3" instance=ExtResource( 1 )] 325 | margin_right = 46.0 326 | margin_bottom = 28.0 327 | 328 | [node name="Panel" parent="Row3/CatapultSize" index="0"] 329 | margin_right = 46.0 330 | margin_bottom = 28.0 331 | 332 | [node name="Label" parent="Row3/CatapultSize/Panel" index="0"] 333 | text = "ctplt size" 334 | 335 | [node name="TextureRect" parent="Row3/CatapultSize/Panel/HBoxContainer" index="0"] 336 | margin_right = 11.0 337 | margin_bottom = 6.0 338 | 339 | [node name="TextureRect2" parent="Row3/CatapultSize/Panel/HBoxContainer" index="1"] 340 | margin_left = 11.0 341 | margin_right = 22.0 342 | margin_bottom = 6.0 343 | 344 | [node name="TextureRect3" parent="Row3/CatapultSize/Panel/HBoxContainer" index="2"] 345 | margin_left = 22.0 346 | margin_right = 33.0 347 | margin_bottom = 6.0 348 | 349 | [node name="TextureRect4" parent="Row3/CatapultSize/Panel/HBoxContainer" index="3"] 350 | margin_left = 33.0 351 | margin_right = 45.0 352 | margin_bottom = 6.0 353 | 354 | [node name="TextureRect" parent="Row3/CatapultSize/Panel/Button" index="0"] 355 | margin_top = 3.0 356 | margin_bottom = 8.0 357 | 358 | [node name="CatapultPower" parent="Row3" instance=ExtResource( 1 )] 359 | margin_left = 48.0 360 | margin_bottom = 28.0 361 | 362 | [node name="Panel" parent="Row3/CatapultPower" index="0"] 363 | margin_right = 46.0 364 | margin_bottom = 28.0 365 | 366 | [node name="Label" parent="Row3/CatapultPower/Panel" index="0"] 367 | margin_left = 1.0 368 | text = "ctplt pwr" 369 | 370 | [node name="TextureRect" parent="Row3/CatapultPower/Panel/HBoxContainer" index="0"] 371 | margin_right = 11.0 372 | margin_bottom = 6.0 373 | 374 | [node name="TextureRect2" parent="Row3/CatapultPower/Panel/HBoxContainer" index="1"] 375 | margin_left = 11.0 376 | margin_right = 22.0 377 | margin_bottom = 6.0 378 | 379 | [node name="TextureRect3" parent="Row3/CatapultPower/Panel/HBoxContainer" index="2"] 380 | margin_left = 22.0 381 | margin_right = 33.0 382 | margin_bottom = 6.0 383 | 384 | [node name="TextureRect4" parent="Row3/CatapultPower/Panel/HBoxContainer" index="3"] 385 | margin_left = 33.0 386 | margin_right = 45.0 387 | margin_bottom = 6.0 388 | 389 | [node name="TextureRect" parent="Row3/CatapultPower/Panel/Button" index="0"] 390 | margin_top = 3.0 391 | margin_bottom = 8.0 392 | 393 | [node name="Row6" type="HBoxContainer" parent="."] 394 | margin_top = 134.0 395 | margin_right = 94.0 396 | margin_bottom = 144.0 397 | rect_min_size = Vector2( 0, 10 ) 398 | size_flags_horizontal = 3 399 | custom_constants/separation = 2 400 | [connection signal="pressed" from="HBoxContainer2/BackButton" to="." method="_on_BackButton_pressed"] 401 | [connection signal="pressed" from="Row4/Cats/Panel/Button" to="Row4/Cats" method="_on_Button_pressed"] 402 | 403 | [editable path="Row/MilkSpawn"] 404 | 405 | [editable path="Row2/Magnet"] 406 | 407 | [editable path="Row2/FishSpawn"] 408 | 409 | [editable path="Row3/CatapultSize"] 410 | 411 | [editable path="Row3/CatapultPower"] 412 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/ShopPanel.gd: -------------------------------------------------------------------------------- 1 | extends Panel 2 | 3 | onready var shopbutton = get_parent().get_node("ShopButton") 4 | onready var money = get_parent().get_node("Money") 5 | 6 | func _ready(): 7 | $Shop.connect("close", self, "_on_shop_close") 8 | 9 | func _on_ShopButton_pressed(): 10 | visible = true 11 | $Shop.update_shop() 12 | shopbutton.visible = false 13 | money.visible = false 14 | 15 | func _on_shop_close(): 16 | visible = false 17 | shopbutton.visible = true 18 | money.visible = true 19 | 20 | func _on_World_show_milk_bar(): 21 | shopbutton.visible = false 22 | 23 | func _on_World_hide_milk_bar(): 24 | shopbutton.visible = true 25 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/Theme.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Theme" load_steps=10 format=2] 2 | 3 | [ext_resource path="res://slkscre.ttf" type="DynamicFontData" id=1] 4 | 5 | [sub_resource type="DynamicFont" id=1] 6 | size = 8 7 | extra_spacing_top = -1 8 | extra_spacing_bottom = -1 9 | extra_spacing_char = -2 10 | font_data = ExtResource( 1 ) 11 | 12 | [sub_resource type="StyleBoxFlat" id=2] 13 | bg_color = Color( 0.152941, 0.152941, 0.266667, 1 ) 14 | border_color = Color( 0.286275, 0.301961, 0.494118, 1 ) 15 | corner_radius_top_left = 2 16 | corner_radius_top_right = 2 17 | corner_radius_bottom_right = 2 18 | corner_radius_bottom_left = 2 19 | anti_aliasing = false 20 | 21 | [sub_resource type="StyleBoxFlat" id=3] 22 | bg_color = Color( 0.984314, 0.960784, 0.937255, 1 ) 23 | border_width_left = 1 24 | border_width_top = 1 25 | border_width_right = 1 26 | border_width_bottom = 1 27 | border_color = Color( 0.545098, 0.427451, 0.611765, 1 ) 28 | corner_radius_top_left = 2 29 | corner_radius_top_right = 2 30 | corner_radius_bottom_right = 2 31 | corner_radius_bottom_left = 2 32 | anti_aliasing = false 33 | 34 | [sub_resource type="StyleBoxFlat" id=4] 35 | bg_color = Color( 0.776471, 0.623529, 0.647059, 1 ) 36 | border_width_left = 1 37 | border_width_top = 1 38 | border_width_right = 1 39 | border_width_bottom = 1 40 | border_color = Color( 0.545098, 0.427451, 0.611765, 1 ) 41 | corner_radius_top_left = 2 42 | corner_radius_top_right = 2 43 | corner_radius_bottom_right = 2 44 | corner_radius_bottom_left = 2 45 | anti_aliasing = false 46 | 47 | [sub_resource type="StyleBoxFlat" id=5] 48 | bg_color = Color( 0.286275, 0.301961, 0.494118, 1 ) 49 | border_width_left = 1 50 | border_width_top = 1 51 | border_width_right = 1 52 | border_width_bottom = 1 53 | border_color = Color( 0.152941, 0.152941, 0.266667, 1 ) 54 | corner_radius_top_left = 2 55 | corner_radius_top_right = 2 56 | corner_radius_bottom_right = 2 57 | corner_radius_bottom_left = 2 58 | anti_aliasing = false 59 | 60 | [sub_resource type="DynamicFont" id=6] 61 | size = 8 62 | outline_color = Color( 0.152941, 0.152941, 0.266667, 1 ) 63 | extra_spacing_top = -1 64 | extra_spacing_bottom = -1 65 | extra_spacing_char = -2 66 | extra_spacing_space = -1 67 | font_data = ExtResource( 1 ) 68 | 69 | [sub_resource type="StyleBoxFlat" id=7] 70 | bg_color = Color( 0.94902, 0.827451, 0.670588, 1 ) 71 | border_width_left = 1 72 | border_width_top = 1 73 | border_width_right = 1 74 | border_width_bottom = 1 75 | border_color = Color( 0.776471, 0.623529, 0.647059, 1 ) 76 | corner_radius_top_left = 5 77 | corner_radius_top_right = 5 78 | corner_radius_bottom_right = 5 79 | corner_radius_bottom_left = 5 80 | anti_aliasing = false 81 | 82 | [sub_resource type="StyleBoxFlat" id=8] 83 | bg_color = Color( 0.94902, 0.827451, 0.670588, 1 ) 84 | border_width_left = 1 85 | border_width_top = 1 86 | border_width_right = 1 87 | border_width_bottom = 1 88 | border_color = Color( 0.776471, 0.623529, 0.647059, 1 ) 89 | corner_radius_top_left = 5 90 | corner_radius_top_right = 5 91 | corner_radius_bottom_right = 5 92 | corner_radius_bottom_left = 5 93 | anti_aliasing = false 94 | 95 | [resource] 96 | Button/colors/font_color = Color( 0.152941, 0.152941, 0.266667, 1 ) 97 | Button/colors/font_color_disabled = Color( 0.286275, 0.301961, 0.494118, 1 ) 98 | Button/colors/font_color_hover = Color( 0.152941, 0.152941, 0.266667, 1 ) 99 | Button/colors/font_color_pressed = Color( 1, 1, 1, 1 ) 100 | Button/constants/hseparation = 2 101 | Button/fonts/font = SubResource( 1 ) 102 | Button/styles/disabled = SubResource( 2 ) 103 | Button/styles/focus = null 104 | Button/styles/hover = SubResource( 3 ) 105 | Button/styles/normal = SubResource( 4 ) 106 | Button/styles/pressed = SubResource( 5 ) 107 | Label/colors/font_color = Color( 0.152941, 0.152941, 0.266667, 1 ) 108 | Label/colors/font_color_shadow = Color( 0.152941, 0.152941, 0.266667, 0 ) 109 | Label/colors/font_outline_modulate = Color( 1, 1, 1, 1 ) 110 | Label/constants/line_spacing = 3 111 | Label/constants/shadow_as_outline = 0 112 | Label/constants/shadow_offset_x = 1 113 | Label/constants/shadow_offset_y = 1 114 | Label/fonts/font = SubResource( 6 ) 115 | Label/styles/normal = SubResource( 7 ) 116 | Panel/styles/panel = SubResource( 8 ) 117 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/UpgradeNode.gd: -------------------------------------------------------------------------------- 1 | extends VBoxContainer 2 | 3 | signal pressed 4 | 5 | var upgrade_code = "" 6 | onready var checkboxes = $Panel/HBoxContainer 7 | onready var check_texture = preload("res://Game/GUI/upgrade-checked.png") 8 | onready var uncheck_texture = preload("res://Game/GUI/upgrade-unchecked.png") 9 | 10 | func set_unlocked_count(count): 11 | var index = 0 12 | for c in checkboxes.get_children(): 13 | if index < count: 14 | c.texture = check_texture 15 | else: 16 | c.texture = uncheck_texture 17 | index +=1 18 | 19 | func set_can_buy(can_buy): 20 | $Panel/Button.disabled = !can_buy 21 | 22 | func set_price(p): 23 | if p>0: 24 | $Panel/Button.text = "x"+String(p) 25 | else: 26 | $Panel/Button.text = "" 27 | $Panel/Button.disabled = true 28 | 29 | 30 | func set_upgrade_code(c): 31 | upgrade_code = c 32 | 33 | func _on_Button_pressed(): 34 | emit_signal("pressed", upgrade_code) 35 | $AudioStreamPlayer.play() 36 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/UpgradeNode.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=2] 2 | 3 | [ext_resource path="res://Game/GUI/upgrade-unchecked.png" type="Texture" id=1] 4 | [ext_resource path="res://Game/GUI/fish4.png" type="Texture" id=2] 5 | [ext_resource path="res://Game/GUI/upgrade-checked.png" type="Texture" id=3] 6 | [ext_resource path="res://Game/GUI/Theme.tres" type="Theme" id=4] 7 | [ext_resource path="res://Game/GUI/UpgradeNode.gd" type="Script" id=5] 8 | [ext_resource path="res://Game/GUI/mixkit-video-game-mystery-alert-234.wav" type="AudioStream" id=6] 9 | 10 | [sub_resource type="StyleBoxFlat" id=1] 11 | bg_color = Color( 0.6, 0.6, 0.6, 0 ) 12 | 13 | [node name="UpgradeNode" type="VBoxContainer"] 14 | margin_right = 94.0 15 | margin_bottom = 118.0 16 | size_flags_horizontal = 3 17 | size_flags_vertical = 3 18 | script = ExtResource( 5 ) 19 | __meta__ = { 20 | "_edit_use_anchors_": false 21 | } 22 | 23 | [node name="Panel" type="Panel" parent="."] 24 | margin_right = 94.0 25 | margin_bottom = 118.0 26 | size_flags_horizontal = 3 27 | size_flags_vertical = 3 28 | theme = ExtResource( 4 ) 29 | 30 | [node name="Label" type="Label" parent="Panel"] 31 | margin_top = 1.0 32 | margin_right = 45.0 33 | margin_bottom = 8.0 34 | size_flags_horizontal = 3 35 | theme = ExtResource( 4 ) 36 | custom_styles/normal = SubResource( 1 ) 37 | custom_colors/font_color = Color( 0.152941, 0.152941, 0.266667, 1 ) 38 | text = "milk PWR" 39 | align = 1 40 | __meta__ = { 41 | "_edit_use_anchors_": false 42 | } 43 | 44 | [node name="HBoxContainer" type="HBoxContainer" parent="Panel"] 45 | anchor_right = 1.0 46 | anchor_bottom = 1.0 47 | margin_top = 8.0 48 | margin_right = -1.0 49 | margin_bottom = -103.0 50 | size_flags_horizontal = 3 51 | size_flags_vertical = 3 52 | custom_constants/separation = 0 53 | __meta__ = { 54 | "_edit_use_anchors_": false 55 | } 56 | 57 | [node name="TextureRect" type="TextureRect" parent="Panel/HBoxContainer"] 58 | margin_right = 23.0 59 | margin_bottom = 7.0 60 | size_flags_horizontal = 3 61 | texture = ExtResource( 3 ) 62 | stretch_mode = 4 63 | 64 | [node name="TextureRect2" type="TextureRect" parent="Panel/HBoxContainer"] 65 | margin_left = 23.0 66 | margin_right = 46.0 67 | margin_bottom = 7.0 68 | size_flags_horizontal = 3 69 | texture = ExtResource( 1 ) 70 | stretch_mode = 4 71 | 72 | [node name="TextureRect3" type="TextureRect" parent="Panel/HBoxContainer"] 73 | margin_left = 46.0 74 | margin_right = 69.0 75 | margin_bottom = 7.0 76 | size_flags_horizontal = 3 77 | texture = ExtResource( 1 ) 78 | stretch_mode = 4 79 | 80 | [node name="TextureRect4" type="TextureRect" parent="Panel/HBoxContainer"] 81 | margin_left = 69.0 82 | margin_right = 93.0 83 | margin_bottom = 7.0 84 | size_flags_horizontal = 3 85 | texture = ExtResource( 1 ) 86 | stretch_mode = 4 87 | 88 | [node name="Button" type="Button" parent="Panel"] 89 | anchor_right = 1.0 90 | anchor_bottom = 1.0 91 | margin_left = 3.0 92 | margin_top = 15.0 93 | margin_right = -3.0 94 | margin_bottom = -2.0 95 | focus_mode = 0 96 | theme = ExtResource( 4 ) 97 | enabled_focus_mode = 0 98 | text = "x500 " 99 | align = 2 100 | __meta__ = { 101 | "_edit_use_anchors_": false 102 | } 103 | 104 | [node name="TextureRect" type="TextureRect" parent="Panel/Button"] 105 | margin_left = 7.0 106 | margin_top = 2.0 107 | margin_right = 14.0 108 | margin_bottom = 7.0 109 | texture = ExtResource( 2 ) 110 | __meta__ = { 111 | "_edit_use_anchors_": false 112 | } 113 | 114 | [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] 115 | stream = ExtResource( 6 ) 116 | volume_db = 5.0 117 | bus = "sound" 118 | [connection signal="pressed" from="Panel/Button" to="." method="_on_Button_pressed"] 119 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/audio-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/audio-off.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/audio-off.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/audio-off.png-1472f11da4ddd92de3c63640f068afe4.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/audio-off.png" 13 | dest_files=[ "res://.import/audio-off.png-1472f11da4ddd92de3c63640f068afe4.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/audio-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/audio-on.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/audio-on.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/audio-on.png-48ed19e22d70881df6aebd5c2d34cc51.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/audio-on.png" 13 | dest_files=[ "res://.import/audio-on.png-48ed19e22d70881df6aebd5c2d34cc51.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/back-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/back-arrow.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/back-arrow.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/back-arrow.png-3239da16857f186b4bc5e3fe49a40305.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/back-arrow.png" 13 | dest_files=[ "res://.import/back-arrow.png-3239da16857f186b4bc5e3fe49a40305.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/fish1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/fish1.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/fish1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/fish1.png-e196fa1408900b136beef3ffe3e99226.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/fish1.png" 13 | dest_files=[ "res://.import/fish1.png-e196fa1408900b136beef3ffe3e99226.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/fish2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/fish2.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/fish2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/fish2.png-5a66260fd948744605864b7e0f7b5dd1.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/fish2.png" 13 | dest_files=[ "res://.import/fish2.png-5a66260fd948744605864b7e0f7b5dd1.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/fish3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/fish3.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/fish3.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/fish3.png-0f1d29a8b5c7ef65f2e85fcbb13bcfe9.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/fish3.png" 13 | dest_files=[ "res://.import/fish3.png-0f1d29a8b5c7ef65f2e85fcbb13bcfe9.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/fish4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/fish4.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/fish4.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/fish4.png-1f419d5b7d405b0307633dc880398a6f.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/fish4.png" 13 | dest_files=[ "res://.import/fish4.png-1f419d5b7d405b0307633dc880398a6f.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/milk-indicator-fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/milk-indicator-fill.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/milk-indicator-fill.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/milk-indicator-fill.png-b4c406ef24b5942c29716afe0f20114b.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/milk-indicator-fill.png" 13 | dest_files=[ "res://.import/milk-indicator-fill.png-b4c406ef24b5942c29716afe0f20114b.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/milk-indicator-under.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/milk-indicator-under.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/milk-indicator-under.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/milk-indicator-under.png-57f7ef787c9c6807f72d1f66432722d9.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/milk-indicator-under.png" 13 | dest_files=[ "res://.import/milk-indicator-under.png-57f7ef787c9c6807f72d1f66432722d9.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/milk-preview-fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/milk-preview-fill.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/milk-preview-fill.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/milk-preview-fill.png-f3aee7fa3c52f851f682309849becb1d.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/milk-preview-fill.png" 13 | dest_files=[ "res://.import/milk-preview-fill.png-f3aee7fa3c52f851f682309849becb1d.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/mixkit-video-game-mystery-alert-234.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/mixkit-video-game-mystery-alert-234.wav -------------------------------------------------------------------------------- /Catapult/Game/GUI/mixkit-video-game-mystery-alert-234.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/mixkit-video-game-mystery-alert-234.wav-548f3dbab08ecda4451a22884aae3e64.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://Game/GUI/mixkit-video-game-mystery-alert-234.wav" 10 | dest_files=[ "res://.import/mixkit-video-game-mystery-alert-234.wav-548f3dbab08ecda4451a22884aae3e64.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/mousebutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/mousebutton.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/mousebutton.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/mousebutton.png-8f2c8a4e33535d17bef653f753da4e85.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/mousebutton.png" 13 | dest_files=[ "res://.import/mousebutton.png-8f2c8a4e33535d17bef653f753da4e85.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/music-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/music-off.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/music-off.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/music-off.png-14764b7be2d2c3a3bd8f16a55fc2d56d.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/music-off.png" 13 | dest_files=[ "res://.import/music-off.png-14764b7be2d2c3a3bd8f16a55fc2d56d.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/music-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/music-on.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/music-on.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/music-on.png-a9c4bfa5a20a29606e55913dfd12a241.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/music-on.png" 13 | dest_files=[ "res://.import/music-on.png-a9c4bfa5a20a29606e55913dfd12a241.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/upgrade-checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/upgrade-checked.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/upgrade-checked.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/upgrade-checked.png-de480e2311728623a2f5fe0353c8f487.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/upgrade-checked.png" 13 | dest_files=[ "res://.import/upgrade-checked.png-de480e2311728623a2f5fe0353c8f487.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/GUI/upgrade-unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/GUI/upgrade-unchecked.png -------------------------------------------------------------------------------- /Catapult/Game/GUI/upgrade-unchecked.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/upgrade-unchecked.png-6cde46cae104ed7b4a2d9fc557cee3fc.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/GUI/upgrade-unchecked.png" 13 | dest_files=[ "res://.import/upgrade-unchecked.png-6cde46cae104ed7b4a2d9fc557cee3fc.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/Game.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | var has_done_launch_tutorial = false 4 | var has_done_trampoline_tutorial = false 5 | var has_done_shop_tutorial = false 6 | var launches = 0 7 | var reached_moon = false 8 | 9 | var sound = true 10 | var music = true 11 | 12 | onready var sound_enabled = preload("res://Game/GUI/audio-on.png") 13 | onready var sound_disabled = preload("res://Game/GUI/audio-off.png") 14 | onready var music_enabled = preload("res://Game/GUI/music-on.png") 15 | onready var music_disabled = preload("res://Game/GUI/music-off.png") 16 | 17 | var sound_bus 18 | var music_bus 19 | 20 | func _ready(): 21 | # this seed has no meaning, dont convert it to anything 22 | seed(636174) 23 | sound_bus = AudioServer.get_bus_index("sound") 24 | music_bus = AudioServer.get_bus_index("music") 25 | 26 | func _on_World_show_trampoline_tutorial(): 27 | if has_done_trampoline_tutorial: 28 | return 29 | has_done_trampoline_tutorial = true 30 | $UI/Tutorial/DragTrampoline.visible = true 31 | Engine.time_scale = 0.0 32 | 33 | func _on_World_show_launch_tutorial(): 34 | if has_done_launch_tutorial: 35 | return 36 | has_done_launch_tutorial = true 37 | $UI/Tutorial/DragCat.visible = true 38 | $UI/Control.visible = true 39 | 40 | 41 | func _on_World_madetrampoline(): 42 | $UI/Tutorial/DragTrampoline.visible = false 43 | Engine.time_scale = 1.0 44 | 45 | func _on_World_launched(): 46 | launches += 1 47 | $UI/Tutorial/DragCat.visible = false 48 | 49 | 50 | func _on_World_reached_moon(): 51 | if reached_moon: 52 | return 53 | reached_moon = true 54 | $CanvasLayer/EndAnimation.set_launches(launches) 55 | $CanvasLayer/EndAnimation.visible = true 56 | $EndAnimation.play("fade") 57 | get_tree().root.get_node("/root/UnlockedUpgrades").reset() 58 | $ResetWorld.start() 59 | 60 | func _on_EndAnimation_play_again(): 61 | launches = 0 62 | reached_moon = false 63 | $EndAnimation.play_backwards("fade") 64 | $UI/Control/Money.text = "0" 65 | 66 | func _on_ResetWorld_timeout(): 67 | $GameLayer/World.reset() 68 | 69 | 70 | func _on_World_show_shop_tutorial(): 71 | if has_done_shop_tutorial: 72 | return 73 | has_done_shop_tutorial = true 74 | $UI/Tutorial/Shop.visible = true 75 | 76 | 77 | func _on_ShopButton_pressed(): 78 | $UI/Tutorial/Shop.visible = false 79 | 80 | 81 | func _on_AudioToggle_pressed(): 82 | if(sound): 83 | AudioServer.set_bus_volume_db(sound_bus, -80) 84 | $UI/AudioToggle.icon = sound_disabled 85 | else: 86 | AudioServer.set_bus_volume_db(sound_bus, 0) 87 | $UI/AudioToggle.icon = sound_enabled 88 | sound = !sound 89 | 90 | func _on_MusicToggle_pressed(): 91 | if(music): 92 | AudioServer.set_bus_volume_db(music_bus, -80) 93 | $UI/MusicToggle.icon = music_disabled 94 | else: 95 | AudioServer.set_bus_volume_db(music_bus, 0) 96 | $UI/MusicToggle.icon = music_enabled 97 | music = !music 98 | -------------------------------------------------------------------------------- /Catapult/Game/Game.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=34 format=2] 2 | 3 | [ext_resource path="res://Game/World/World.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://Game/ForeGround/ground.png" type="Texture" id=2] 5 | [ext_resource path="res://Game/GUI/MilkInfo.tscn" type="PackedScene" id=3] 6 | [ext_resource path="res://Game/Background/mountain-right.png" type="Texture" id=4] 7 | [ext_resource path="res://Game/Background/mountain-left.png" type="Texture" id=5] 8 | [ext_resource path="res://Game/EndAnimation/EndAnimation.tscn" type="PackedScene" id=6] 9 | [ext_resource path="res://Game/Background/MoonLight.tres" type="Material" id=7] 10 | [ext_resource path="res://Game/Background/cloud-particle.png" type="Texture" id=8] 11 | [ext_resource path="res://Game/Background/CloudParticles.tres" type="Material" id=9] 12 | [ext_resource path="res://Game/Background/star-particles.png" type="Texture" id=10] 13 | [ext_resource path="res://Game/Background/Stars.tres" type="Material" id=11] 14 | [ext_resource path="res://Game/GUI/Shop.tscn" type="PackedScene" id=12] 15 | [ext_resource path="res://Game/GUI/Theme.tres" type="Theme" id=13] 16 | [ext_resource path="res://Game/Game.gd" type="Script" id=14] 17 | [ext_resource path="res://Game/GUI/ShopPanel.gd" type="Script" id=15] 18 | [ext_resource path="res://slkscre.ttf" type="DynamicFontData" id=16] 19 | [ext_resource path="res://Game/GUI/fish4.png" type="Texture" id=17] 20 | [ext_resource path="res://Game/GUI/MoneyLabel.gd" type="Script" id=18] 21 | [ext_resource path="res://Game/Background/ReflectTexture.shader" type="Shader" id=19] 22 | [ext_resource path="res://Game/GUI/audio-on.png" type="Texture" id=20] 23 | [ext_resource path="res://Game/GUI/music-on.png" type="Texture" id=21] 24 | 25 | [sub_resource type="CanvasItemMaterial" id=1] 26 | particles_animation = true 27 | particles_anim_h_frames = 9 28 | particles_anim_v_frames = 1 29 | particles_anim_loop = false 30 | 31 | [sub_resource type="ShaderMaterial" id=2] 32 | shader = ExtResource( 19 ) 33 | shader_param/noiseSize = 15.0 34 | shader_param/speed = -0.4 35 | shader_param/albedo = 0.7 36 | 37 | [sub_resource type="ShaderMaterial" id=3] 38 | shader = ExtResource( 19 ) 39 | shader_param/noiseSize = 15.47 40 | shader_param/speed = -0.4 41 | shader_param/albedo = 0.7 42 | 43 | [sub_resource type="CanvasItemMaterial" id=4] 44 | particles_animation = true 45 | particles_anim_h_frames = 3 46 | particles_anim_v_frames = 1 47 | particles_anim_loop = false 48 | 49 | [sub_resource type="DynamicFont" id=5] 50 | size = 8 51 | outline_size = 1 52 | use_mipmaps = true 53 | extra_spacing_char = -2 54 | font_data = ExtResource( 16 ) 55 | 56 | [sub_resource type="DynamicFont" id=6] 57 | font_data = ExtResource( 16 ) 58 | 59 | [sub_resource type="DynamicFont" id=7] 60 | size = 8 61 | outline_size = 1 62 | outline_color = Color( 0.152941, 0.152941, 0.266667, 1 ) 63 | use_mipmaps = true 64 | extra_spacing_char = -2 65 | font_data = ExtResource( 16 ) 66 | 67 | [sub_resource type="StyleBoxFlat" id=8] 68 | bg_color = Color( 0.6, 0.6, 0.6, 0 ) 69 | 70 | [sub_resource type="StyleBoxFlat" id=9] 71 | bg_color = Color( 0.6, 0.6, 0.6, 0 ) 72 | 73 | [sub_resource type="StyleBoxFlat" id=10] 74 | bg_color = Color( 0.6, 0.6, 0.6, 0 ) 75 | 76 | [sub_resource type="DynamicFont" id=11] 77 | 78 | [sub_resource type="Animation" id=12] 79 | tracks/0/type = "value" 80 | tracks/0/path = NodePath("CanvasLayer/Fade:modulate") 81 | tracks/0/interp = 1 82 | tracks/0/loop_wrap = true 83 | tracks/0/imported = false 84 | tracks/0/enabled = true 85 | tracks/0/keys = { 86 | "times": PoolRealArray( 0, 0.5, 1 ), 87 | "transitions": PoolRealArray( 1, 1, 1 ), 88 | "update": 0, 89 | "values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ] 90 | } 91 | tracks/1/type = "value" 92 | tracks/1/path = NodePath("CanvasLayer/EndAnimation:visible") 93 | tracks/1/interp = 1 94 | tracks/1/loop_wrap = true 95 | tracks/1/imported = false 96 | tracks/1/enabled = true 97 | tracks/1/keys = { 98 | "times": PoolRealArray( 0, 0.4, 0.5, 1 ), 99 | "transitions": PoolRealArray( 1, 1, 1, 1 ), 100 | "update": 1, 101 | "values": [ false, false, true, true ] 102 | } 103 | tracks/2/type = "value" 104 | tracks/2/path = NodePath("CanvasLayer/EndAnimation:modulate") 105 | tracks/2/interp = 1 106 | tracks/2/loop_wrap = true 107 | tracks/2/imported = false 108 | tracks/2/enabled = true 109 | tracks/2/keys = { 110 | "times": PoolRealArray( 0, 0.4, 0.5, 1 ), 111 | "transitions": PoolRealArray( 1, 1, 1, 1 ), 112 | "update": 0, 113 | "values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ) ] 114 | } 115 | 116 | [node name="Game" type="Node"] 117 | script = ExtResource( 14 ) 118 | 119 | [node name="BackgroundColor" type="CanvasLayer" parent="."] 120 | layer = -10 121 | 122 | [node name="ColorRect" type="ColorRect" parent="BackgroundColor"] 123 | anchor_right = 1.0 124 | anchor_bottom = 1.0 125 | mouse_filter = 2 126 | color = Color( 0.152941, 0.152941, 0.266667, 1 ) 127 | __meta__ = { 128 | "_edit_use_anchors_": false 129 | } 130 | 131 | [node name="ParallaxBackground" type="ParallaxBackground" parent="."] 132 | layer = 0 133 | 134 | [node name="Sky" type="ParallaxLayer" parent="ParallaxBackground"] 135 | motion_scale = Vector2( 1, 0.3 ) 136 | motion_mirroring = Vector2( 0, 150 ) 137 | 138 | [node name="Stars" type="Particles2D" parent="ParallaxBackground/Sky"] 139 | material = SubResource( 1 ) 140 | position = Vector2( 50, 55 ) 141 | amount = 10 142 | lifetime = 30.0 143 | preprocess = 30.0 144 | process_material = ExtResource( 11 ) 145 | texture = ExtResource( 10 ) 146 | 147 | [node name="OceanView" type="ParallaxLayer" parent="ParallaxBackground"] 148 | 149 | [node name="mountain-left" type="Sprite" parent="ParallaxBackground/OceanView"] 150 | position = Vector2( 0, 89 ) 151 | texture = ExtResource( 5 ) 152 | centered = false 153 | 154 | [node name="mountain-right" type="Sprite" parent="ParallaxBackground/OceanView"] 155 | position = Vector2( 81, 99 ) 156 | texture = ExtResource( 4 ) 157 | centered = false 158 | 159 | [node name="Ocean" type="ColorRect" parent="ParallaxBackground/OceanView"] 160 | margin_top = 121.0 161 | margin_right = 100.0 162 | margin_bottom = 149.0 163 | mouse_filter = 2 164 | color = Color( 0.286275, 0.301961, 0.494118, 1 ) 165 | __meta__ = { 166 | "_edit_use_anchors_": false 167 | } 168 | 169 | [node name="MoonStripe" type="ColorRect" parent="ParallaxBackground/OceanView"] 170 | margin_left = 20.0 171 | margin_top = 121.0 172 | margin_right = 80.0 173 | margin_bottom = 122.0 174 | mouse_filter = 2 175 | color = Color( 0.984314, 0.960784, 0.937255, 1 ) 176 | __meta__ = { 177 | "_edit_use_anchors_": false 178 | } 179 | 180 | [node name="MoonLight" type="ColorRect" parent="ParallaxBackground/OceanView"] 181 | material = ExtResource( 7 ) 182 | margin_left = 48.0 183 | margin_top = 122.0 184 | margin_right = 83.0 185 | margin_bottom = 151.0 186 | mouse_filter = 2 187 | __meta__ = { 188 | "_edit_use_anchors_": false 189 | } 190 | 191 | [node name="MountainReflect2" type="Sprite" parent="ParallaxBackground/OceanView"] 192 | material = SubResource( 2 ) 193 | position = Vector2( 81, 121 ) 194 | texture = ExtResource( 4 ) 195 | centered = false 196 | 197 | [node name="MountainReflect3" type="Sprite" parent="ParallaxBackground/OceanView"] 198 | material = SubResource( 3 ) 199 | position = Vector2( 0, 121 ) 200 | texture = ExtResource( 5 ) 201 | centered = false 202 | 203 | [node name="Clouds" type="ParallaxBackground" parent="."] 204 | layer = -1 205 | 206 | [node name="Clouds" type="ParallaxLayer" parent="Clouds"] 207 | motion_scale = Vector2( 1, 0.6 ) 208 | 209 | [node name="Particles2D" type="Particles2D" parent="Clouds/Clouds"] 210 | material = SubResource( 4 ) 211 | position = Vector2( -40, 45 ) 212 | amount = 10 213 | lifetime = 60.0 214 | preprocess = 60.0 215 | process_material = ExtResource( 9 ) 216 | texture = ExtResource( 8 ) 217 | 218 | [node name="GameLayer" type="CanvasLayer" parent="."] 219 | layer = 2 220 | follow_viewport_enable = true 221 | 222 | [node name="World" parent="GameLayer" instance=ExtResource( 1 )] 223 | 224 | [node name="ForeGround" type="CanvasLayer" parent="."] 225 | layer = 3 226 | follow_viewport_enable = true 227 | 228 | [node name="Sprite" type="Sprite" parent="ForeGround"] 229 | position = Vector2( 50, 148 ) 230 | texture = ExtResource( 2 ) 231 | 232 | [node name="UI" type="CanvasLayer" parent="."] 233 | layer = 5 234 | 235 | [node name="Control" type="Control" parent="UI"] 236 | visible = false 237 | anchor_right = 1.0 238 | anchor_bottom = 1.0 239 | mouse_filter = 2 240 | __meta__ = { 241 | "_edit_use_anchors_": false 242 | } 243 | 244 | [node name="MilkInfo" parent="UI/Control" instance=ExtResource( 3 )] 245 | visible = false 246 | 247 | [node name="ShopPanel" type="Panel" parent="UI/Control"] 248 | visible = false 249 | anchor_right = 1.0 250 | anchor_bottom = 1.0 251 | theme = ExtResource( 13 ) 252 | script = ExtResource( 15 ) 253 | __meta__ = { 254 | "_edit_use_anchors_": false 255 | } 256 | 257 | [node name="Shop" parent="UI/Control/ShopPanel" instance=ExtResource( 12 )] 258 | 259 | [node name="ShopButton" type="Button" parent="UI/Control"] 260 | margin_left = -1.0 261 | margin_top = -1.0 262 | margin_right = 23.0 263 | margin_bottom = 8.0 264 | focus_mode = 0 265 | theme = ExtResource( 13 ) 266 | enabled_focus_mode = 0 267 | text = "shop" 268 | 269 | [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="UI/Control/ShopButton"] 270 | bus = "sound" 271 | 272 | [node name="Money" type="Label" parent="UI/Control"] 273 | margin_left = 67.0 274 | margin_right = 88.0 275 | margin_bottom = 9.0 276 | custom_fonts/font = SubResource( 5 ) 277 | custom_colors/font_color = Color( 0.984314, 0.960784, 0.937255, 1 ) 278 | custom_colors/font_outline_modulate = Color( 0.152941, 0.152941, 0.266667, 1 ) 279 | text = "0" 280 | align = 2 281 | script = ExtResource( 18 ) 282 | __meta__ = { 283 | "_edit_use_anchors_": false 284 | } 285 | 286 | [node name="TextureRect" type="TextureRect" parent="UI/Control/Money"] 287 | margin_left = 24.0 288 | margin_top = 2.0 289 | margin_right = 31.0 290 | margin_bottom = 7.0 291 | texture = ExtResource( 17 ) 292 | __meta__ = { 293 | "_edit_use_anchors_": false 294 | } 295 | 296 | [node name="Label" type="Label" parent="UI"] 297 | visible = false 298 | anchor_right = 1.0 299 | anchor_bottom = 1.0 300 | margin_bottom = -29.0 301 | custom_fonts/font = SubResource( 6 ) 302 | custom_colors/font_color = Color( 0.984314, 0.960784, 0.937255, 1 ) 303 | text = "CAT 304 | APULT" 305 | align = 1 306 | valign = 1 307 | __meta__ = { 308 | "_edit_use_anchors_": false 309 | } 310 | 311 | [node name="Tutorial" type="Control" parent="UI"] 312 | margin_right = 40.0 313 | margin_bottom = 40.0 314 | mouse_filter = 2 315 | __meta__ = { 316 | "_edit_use_anchors_": false 317 | } 318 | 319 | [node name="DragCat" type="Label" parent="UI/Tutorial"] 320 | visible = false 321 | margin_left = 1.0 322 | margin_top = 53.0 323 | margin_right = 101.0 324 | margin_bottom = 74.0 325 | rect_min_size = Vector2( 100, 0 ) 326 | custom_fonts/font = SubResource( 7 ) 327 | custom_colors/font_color = Color( 0.984314, 0.960784, 0.937255, 1 ) 328 | text = "drag cat into catapult 329 | and let go to launch" 330 | __meta__ = { 331 | "_edit_use_anchors_": false 332 | } 333 | 334 | [node name="DragTrampoline" type="Label" parent="UI/Tutorial"] 335 | visible = false 336 | margin_top = 40.0 337 | margin_right = 100.0 338 | margin_bottom = 85.0 339 | rect_min_size = Vector2( 100, 0 ) 340 | custom_fonts/font = SubResource( 7 ) 341 | custom_colors/font_color = Color( 0.984314, 0.960784, 0.937255, 1 ) 342 | text = "drag mouse under cat 343 | to create a trampoline 344 | 345 | this uses milk (topleft)" 346 | __meta__ = { 347 | "_edit_use_anchors_": false 348 | } 349 | 350 | [node name="Shop" type="Label" parent="UI/Tutorial"] 351 | visible = false 352 | margin_left = 1.0 353 | margin_top = 93.0 354 | margin_right = 101.0 355 | margin_bottom = 102.0 356 | custom_fonts/font = SubResource( 7 ) 357 | custom_colors/font_color = Color( 0.984314, 0.960784, 0.937255, 1 ) 358 | text = "click topleft to shop" 359 | align = 1 360 | __meta__ = { 361 | "_edit_use_anchors_": false 362 | } 363 | 364 | [node name="MouseCatch" type="Control" parent="UI/Tutorial/Shop"] 365 | margin_left = -1.0 366 | margin_top = -4.0 367 | margin_right = 99.0 368 | margin_bottom = 57.0 369 | rect_min_size = Vector2( 100, 50 ) 370 | 371 | [node name="AudioToggle" type="Button" parent="UI"] 372 | margin_left = 92.0 373 | margin_top = 16.0 374 | margin_right = 100.0 375 | margin_bottom = 24.0 376 | focus_mode = 0 377 | custom_styles/hover = SubResource( 8 ) 378 | custom_styles/pressed = SubResource( 9 ) 379 | custom_styles/normal = SubResource( 10 ) 380 | custom_fonts/font = SubResource( 11 ) 381 | enabled_focus_mode = 0 382 | icon = ExtResource( 20 ) 383 | __meta__ = { 384 | "_edit_use_anchors_": false 385 | } 386 | 387 | [node name="MusicToggle" type="Button" parent="UI"] 388 | margin_left = 92.0 389 | margin_top = 8.0 390 | margin_right = 100.0 391 | margin_bottom = 16.0 392 | focus_mode = 0 393 | custom_styles/hover = SubResource( 8 ) 394 | custom_styles/pressed = SubResource( 9 ) 395 | custom_styles/normal = SubResource( 10 ) 396 | custom_fonts/font = SubResource( 11 ) 397 | enabled_focus_mode = 0 398 | icon = ExtResource( 21 ) 399 | __meta__ = { 400 | "_edit_use_anchors_": false 401 | } 402 | 403 | [node name="CanvasLayer" type="CanvasLayer" parent="."] 404 | layer = 5 405 | 406 | [node name="EndAnimation" parent="CanvasLayer" instance=ExtResource( 6 )] 407 | visible = false 408 | modulate = Color( 1, 1, 1, 0 ) 409 | 410 | [node name="Fade" type="ColorRect" parent="CanvasLayer"] 411 | visible = false 412 | modulate = Color( 1, 1, 1, 0 ) 413 | anchor_right = 1.0 414 | anchor_bottom = 1.0 415 | mouse_filter = 2 416 | color = Color( 0.152941, 0.152941, 0.266667, 1 ) 417 | __meta__ = { 418 | "_edit_use_anchors_": false 419 | } 420 | 421 | [node name="EndAnimation" type="AnimationPlayer" parent="."] 422 | anims/fade = SubResource( 12 ) 423 | 424 | [node name="ResetWorld" type="Timer" parent="."] 425 | wait_time = 0.5 426 | one_shot = true 427 | [connection signal="hide_milk_bar" from="GameLayer/World" to="UI/Control/MilkInfo" method="_on_World_hide_milk_bar"] 428 | [connection signal="hide_milk_bar" from="GameLayer/World" to="UI/Control/ShopPanel" method="_on_World_hide_milk_bar"] 429 | [connection signal="launched" from="GameLayer/World" to="." method="_on_World_launched"] 430 | [connection signal="madetrampoline" from="GameLayer/World" to="." method="_on_World_madetrampoline"] 431 | [connection signal="reached_moon" from="GameLayer/World" to="." method="_on_World_reached_moon"] 432 | [connection signal="show_launch_tutorial" from="GameLayer/World" to="." method="_on_World_show_launch_tutorial"] 433 | [connection signal="show_milk_bar" from="GameLayer/World" to="UI/Control/MilkInfo" method="_on_World_show_milk_bar"] 434 | [connection signal="show_milk_bar" from="GameLayer/World" to="UI/Control/ShopPanel" method="_on_World_show_milk_bar"] 435 | [connection signal="show_shop_tutorial" from="GameLayer/World" to="." method="_on_World_show_shop_tutorial"] 436 | [connection signal="show_trampoline_tutorial" from="GameLayer/World" to="." method="_on_World_show_trampoline_tutorial"] 437 | [connection signal="update_milk" from="GameLayer/World" to="UI/Control/MilkInfo" method="_on_World_update_milk"] 438 | [connection signal="pressed" from="UI/Control/ShopButton" to="." method="_on_ShopButton_pressed"] 439 | [connection signal="pressed" from="UI/Control/ShopButton" to="UI/Control/ShopPanel" method="_on_ShopButton_pressed"] 440 | [connection signal="pressed" from="UI/AudioToggle" to="." method="_on_AudioToggle_pressed"] 441 | [connection signal="pressed" from="UI/MusicToggle" to="." method="_on_MusicToggle_pressed"] 442 | [connection signal="play_again" from="CanvasLayer/EndAnimation" to="." method="_on_EndAnimation_play_again"] 443 | [connection signal="timeout" from="ResetWorld" to="." method="_on_ResetWorld_timeout"] 444 | -------------------------------------------------------------------------------- /Catapult/Game/Upgrades/UnlockedUpgrades.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | signal upgraded 4 | signal change_money 5 | 6 | #why is the money var here? idk 7 | var money = 0 8 | 9 | var upgrades = { 10 | #there were gonna be more cats, but I got too lazy to add them. 11 | "cats": [ 12 | {"unlocked": true, "price": 0, "value": preload("res://Game/World/Cats/Olin/Olin.tscn")}, 13 | {"unlocked": false, "price": 50, "value": preload("res://Game/World/Cats/Olin/Olin.tscn")}, 14 | {"unlocked": false, "price": 100, "value": preload("res://Game/World/Cats/Olin/Olin.tscn")}, 15 | {"unlocked": false, "price": 200, "value": preload("res://Game/World/Cats/Olin/Olin.tscn")}, 16 | {"unlocked": false, "price": 300, "value": preload("res://Game/World/Cats/Olin/Olin.tscn")} 17 | ], 18 | "milk_spawn_chance": [ 19 | {"unlocked":true, "price": 0, "value": 0.0015}, 20 | {"unlocked":false,"price": 225, "value": 0.0025}, 21 | {"unlocked":false,"price": 350, "value": 0.0035}, 22 | {"unlocked":false,"price": 450, "value": 0.0045} 23 | ], 24 | "money_spawn_chance": [ 25 | {"unlocked":true, "price": 0, "value": 0.03}, 26 | {"unlocked":false,"price": 175, "value": 0.05}, 27 | {"unlocked":false,"price": 350, "value": 0.07}, 28 | {"unlocked":false,"price": 600, "value": 0.09} 29 | ], 30 | "trampoline_strength": [ 31 | {"unlocked":true, "price": 0, "value": 1.1}, 32 | {"unlocked":false,"price": 150, "value": 1.2}, 33 | {"unlocked":false,"price": 300, "value": 1.3}, 34 | {"unlocked":false,"price": 550, "value": 1.4} 35 | ], 36 | "catapult_height": [ 37 | {"unlocked":true, "price": 0, "value": 135}, 38 | {"unlocked":false,"price": 75, "value": 127}, 39 | {"unlocked":false,"price": 175, "value": 120}, 40 | {"unlocked":false,"price": 275, "value": 115} 41 | ], 42 | "catapult_strength": [ 43 | {"unlocked":true, "price": 0, "value": 1.1}, 44 | {"unlocked":false,"price": 250, "value": 1.35}, 45 | {"unlocked":false,"price": 400, "value": 1.75}, 46 | {"unlocked":false,"price": 650, "value": 2.0} 47 | ], 48 | "magnet_strength": [ 49 | {"unlocked":true, "price": 0, "value": 1.0}, 50 | {"unlocked":false,"price": 50, "value": 2.0}, 51 | {"unlocked":false,"price": 175, "value": 3.0}, 52 | {"unlocked":false,"price": 400, "value": 5.0} 53 | ] 54 | } 55 | 56 | func get_money(): 57 | return money 58 | 59 | func add_money(m): 60 | money += m 61 | emit_signal("change_money", money) 62 | 63 | func buy_upgrade(upgr): 64 | if can_unlock_next_upgrade(upgr): 65 | var next = get_next_upgrade(upgr) 66 | money -= next.price 67 | next.unlocked = true 68 | emit_signal("upgraded") 69 | emit_signal("change_money", money) 70 | 71 | func can_unlock_next_upgrade(upgr): 72 | var next = get_next_upgrade(upgr) 73 | if next != null: 74 | return money >= next.price 75 | return false 76 | 77 | func get_unlocked_count(upgr): 78 | var upgrade = upgrades[upgr] 79 | var count = 0 80 | for u in upgrade: 81 | if u.unlocked: 82 | count += 1 83 | return count 84 | 85 | func get_next_upgrade(upgr): 86 | var upgrade = upgrades[upgr] 87 | for u in upgrade: 88 | if !u.unlocked: 89 | return u 90 | 91 | func get_upgrade_value(upgr): 92 | var upgrade = upgrades[upgr] 93 | for i in range(upgrade.size()-1, -1,-1): 94 | if upgrade[i].unlocked: 95 | return upgrade[i].value 96 | 97 | func reset(): 98 | money = 0 99 | for k in upgrades.keys(): 100 | for i in upgrades[k].size(): 101 | if i != 0: 102 | upgrades[k][i].unlocked = false 103 | 104 | -------------------------------------------------------------------------------- /Catapult/Game/Upgrades/UnlockedUpgrades.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Game/Upgrades/UnlockedUpgrades.gd" type="Script" id=1] 4 | 5 | [node name="UnlockedUpgrades" type="Node"] 6 | script = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /Catapult/Game/World/BounceLineDrawer.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | signal remove_milk 4 | signal visual_change_milk 5 | signal made_trampoline 6 | 7 | onready var line = $Line2D 8 | onready var outline = $Outline 9 | onready var trampoline = preload("res://Game/World/Trampoline/Trampoline.tscn") 10 | onready var trampoline_holder = get_parent().get_node("Trampolines") 11 | 12 | const milk_per_length = 1.0 13 | var current_length = 0 14 | 15 | enum STATES {DISABLED, IDLE, DRAWING} 16 | var state = STATES.DISABLED 17 | var draw_point = Vector2() 18 | var camera_height = 0 19 | var screen_height = 150 20 | 21 | var cat_current_milk = 100 22 | 23 | 24 | func go_active(): 25 | state = STATES.IDLE 26 | 27 | 28 | func disable(): 29 | state = STATES.DISABLED 30 | line.points[0] = Vector2.ZERO 31 | line.points[1] = Vector2.ZERO 32 | outline.points[1] = Vector2.ZERO 33 | 34 | func _input(event): 35 | if event is InputEventScreenTouch: 36 | if state == STATES.IDLE && event.pressed: 37 | _start_draw() 38 | if state == STATES.DRAWING && !event.pressed: 39 | _stop_draw() 40 | 41 | func _start_draw(): 42 | state = STATES.DRAWING 43 | draw_point = get_global_mouse_position() 44 | line.global_position = draw_point + Vector2(0,camera_height-.5*screen_height) 45 | outline.global_position = draw_point + Vector2(0,camera_height-.5*screen_height) 46 | line.points[1] = Vector2.ZERO 47 | outline.points[1] = Vector2.ZERO 48 | 49 | func _physics_process(_delta): 50 | match state: 51 | STATES.IDLE: 52 | if Input.is_action_just_pressed("mouse_left"): 53 | _start_draw() 54 | STATES.DRAWING: 55 | _draw_trampoline_line() 56 | if Input.is_action_just_released("mouse_left"): 57 | _stop_draw() 58 | 59 | func _stop_draw(): 60 | state = STATES.IDLE 61 | _make_trampoline(line.global_position, line.points[1]) 62 | emit_signal("remove_milk", current_length/milk_per_length) 63 | 64 | func _draw_trampoline_line(): 65 | if cat_current_milk < 1.0: 66 | return 67 | 68 | line.global_position = draw_point + Vector2(0,camera_height-.5*screen_height) 69 | outline.global_position = draw_point + Vector2(0,camera_height-.5*screen_height) 70 | current_length = (get_global_mouse_position() - draw_point).length() 71 | var actual = (get_global_mouse_position() - draw_point).normalized() 72 | 73 | if cat_current_milk < current_length * milk_per_length: 74 | actual *= cat_current_milk / milk_per_length 75 | emit_signal("visual_change_milk", cat_current_milk) 76 | else: 77 | actual *= current_length 78 | emit_signal("visual_change_milk", current_length/milk_per_length) 79 | 80 | line.points[1] = actual 81 | outline.points[1] = actual 82 | 83 | 84 | func _make_trampoline(where, size): 85 | line.points[0] = Vector2.ZERO 86 | line.points[1] = Vector2.ZERO 87 | outline.points[1] = Vector2.ZERO 88 | var t = trampoline.instance() 89 | trampoline_holder.add_child(t) 90 | t.global_position = where 91 | t.set_length(size) 92 | emit_signal("made_trampoline") 93 | 94 | func _on_Camera2D_change_height(h): 95 | camera_height = h 96 | 97 | func update_cat_milk(m): 98 | cat_current_milk = m 99 | 100 | -------------------------------------------------------------------------------- /Catapult/Game/World/Camera2D.gd: -------------------------------------------------------------------------------- 1 | extends Camera2D 2 | 3 | signal track_object_fallen 4 | signal change_height 5 | signal cat_falling 6 | 7 | enum STATES {IDLE, TRACKING} 8 | var state = STATES.IDLE 9 | var track_object = null 10 | var lowest_y = 75 11 | 12 | func track(object): 13 | state = STATES.TRACKING 14 | track_object = object 15 | lowest_y = 75 16 | 17 | func go_idle(): 18 | state = STATES.IDLE 19 | 20 | func reset(): 21 | lowest_y = 75 22 | track_object = null 23 | position.y = 75 24 | 25 | func _physics_process(_delta): 26 | if state == STATES.TRACKING: 27 | if track_object.position.y > lowest_y && lowest_y < -200: 28 | emit_signal("cat_falling") 29 | 30 | lowest_y = min(lowest_y, track_object.position.y) 31 | position.y = lowest_y 32 | emit_signal("change_height", position.y) 33 | 34 | if track_object.position.y - lowest_y > 100: 35 | emit_signal("track_object_fallen") 36 | -------------------------------------------------------------------------------- /Catapult/Game/World/Catapult/Catapult.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | signal launch_cat 4 | 5 | onready var upgrades = get_tree().root.get_node("/root/UnlockedUpgrades") 6 | onready var mousestate = get_tree().root.get_node("/root/MouseControl") 7 | onready var line = $Line2D 8 | onready var tween = $Tween 9 | onready var pullbox = $PullStartBox 10 | 11 | enum STATES {IDLE, PULLED,CAT_PULLED,RELEASED} 12 | var state = STATES.IDLE 13 | var max_length = 35 14 | 15 | 16 | func _ready(): 17 | upgrades.connect("upgraded", self, "check_upgrades") 18 | 19 | func check_upgrades(): 20 | position.y = upgrades.get_upgrade_value("catapult_height") 21 | max_length = 140-line.global_position.y 22 | 23 | func _on_PullStartBox_input_event(_viewport, event, _shape_idx): 24 | if state == STATES.IDLE: 25 | if event is InputEventMouseMotion && mousestate.is_cat_grab(): 26 | _pull_cat() 27 | 28 | if event is InputEventMouseButton && event.button_index == BUTTON_LEFT: 29 | if event.pressed && mousestate.is_idle(): 30 | _pull() 31 | 32 | func set_center_string(pos): 33 | line.points[1] = pos 34 | pullbox.position = pos + line.position 35 | 36 | func _input(event): 37 | if event is InputEventScreenTouch && mousestate.is_catapult(): 38 | call_deferred("_release") 39 | 40 | func _physics_process(_delta): 41 | if Input.is_action_just_released("mouse_left") && mousestate.is_catapult(): 42 | if (state == STATES.PULLED || state == STATES.CAT_PULLED): 43 | _release() 44 | 45 | if state == STATES.PULLED || state == STATES.CAT_PULLED: 46 | _pull_line() 47 | 48 | func _pull_line(): 49 | var pull_pos = get_global_mouse_position() - global_position - line.position 50 | var length = pull_pos.length() 51 | if length > max_length: 52 | pull_pos = pull_pos.normalized()*max_length 53 | 54 | line.points[1] = pull_pos 55 | pullbox.position = pull_pos + line.position 56 | 57 | if state == STATES.CAT_PULLED: 58 | mousestate.get_held_cat().global_position = pull_pos + position + line.position 59 | 60 | func set_state_idle(): 61 | state = STATES.IDLE 62 | mousestate.set_state_idle() 63 | 64 | func _release(): 65 | if state == STATES.CAT_PULLED: 66 | _launch_cat() 67 | 68 | state = STATES.RELEASED 69 | #tween.interpolate_method(self, "set_center_string", line.points[1], Vector2.ZERO, 0.05,Tween.TRANS_LINEAR, Tween.EASE_IN) 70 | tween.interpolate_method(self, "set_center_string", line.points[1], Vector2.ZERO, 0.2,Tween.TRANS_BACK, Tween.EASE_OUT) 71 | tween.interpolate_callback(self, 0.2, "set_state_idle") 72 | tween.start() 73 | $AudioStreamPlayer2D.play() 74 | #pullbox.position = Vector2(0,-34) 75 | 76 | func _launch_cat(): 77 | mousestate.set_state_flying() 78 | var launch_vec = line.points[1] 79 | emit_signal("launch_cat", launch_vec) 80 | 81 | func _pull_cat(): 82 | mousestate.set_state_catapult() 83 | state = STATES.CAT_PULLED 84 | mousestate.get_held_cat().set_state_seated() 85 | 86 | func _pull(): 87 | mousestate.set_state_catapult() 88 | state = STATES.PULLED 89 | -------------------------------------------------------------------------------- /Catapult/Game/World/Catapult/Catapult.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=7 format=2] 2 | 3 | [ext_resource path="res://Game/World/Catapult/Catapult.gd" type="Script" id=1] 4 | [ext_resource path="res://Game/World/Catapult/slingshot.png" type="Texture" id=2] 5 | [ext_resource path="res://Game/World/Catapult/holder.png" type="Texture" id=3] 6 | [ext_resource path="res://Game/World/Trampoline/wobble1.wav" type="AudioStream" id=4] 7 | 8 | [sub_resource type="CircleShape2D" id=1] 9 | 10 | [sub_resource type="AudioStreamRandomPitch" id=2] 11 | audio_stream = ExtResource( 4 ) 12 | 13 | [node name="Catapult" type="Node2D"] 14 | script = ExtResource( 1 ) 15 | __meta__ = { 16 | "_edit_group_": true 17 | } 18 | 19 | [node name="Sprite" type="Sprite" parent="."] 20 | texture = ExtResource( 2 ) 21 | 22 | [node name="Line2D" type="Line2D" parent="."] 23 | position = Vector2( 0, -34 ) 24 | points = PoolVector2Array( -10, 0, 0, 0, 10, 0 ) 25 | width = 1.5 26 | default_color = Color( 0.984314, 0.960784, 0.937255, 1 ) 27 | 28 | [node name="PullStartBox" type="Area2D" parent="."] 29 | position = Vector2( 0, -34 ) 30 | 31 | [node name="CollisionShape2D" type="CollisionShape2D" parent="PullStartBox"] 32 | shape = SubResource( 1 ) 33 | 34 | [node name="Sprite" type="Sprite" parent="PullStartBox"] 35 | z_index = 1 36 | texture = ExtResource( 3 ) 37 | 38 | [node name="Tween" type="Tween" parent="."] 39 | 40 | [node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] 41 | stream = SubResource( 2 ) 42 | bus = "sound" 43 | [connection signal="input_event" from="PullStartBox" to="." method="_on_PullStartBox_input_event"] 44 | -------------------------------------------------------------------------------- /Catapult/Game/World/Catapult/holder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/Catapult/holder.png -------------------------------------------------------------------------------- /Catapult/Game/World/Catapult/holder.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/holder.png-23b0d14a636f4c96bbdfcd667e8b5eaa.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/Catapult/holder.png" 13 | dest_files=[ "res://.import/holder.png-23b0d14a636f4c96bbdfcd667e8b5eaa.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/Catapult/slingshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/Catapult/slingshot.png -------------------------------------------------------------------------------- /Catapult/Game/World/Catapult/slingshot.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/slingshot.png-637607f2eb25ae14984b90ec82fa284c.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/Catapult/slingshot.png" 13 | dest_files=[ "res://.import/slingshot.png-637607f2eb25ae14984b90ec82fa284c.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/Cat.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | signal change_milk 4 | signal landed 5 | const max_milk = 100.0 6 | 7 | onready var upgrades = get_tree().root.get_node("/root/UnlockedUpgrades") 8 | onready var mousestate = get_tree().root.get_node("/root/MouseControl") 9 | onready var animation = $AnimatedSprite 10 | onready var launch_particles = $LaunchParticles 11 | onready var magnet_shape = $MagnetArea/CollisionShape2D 12 | enum STATES {NOT_STARTED, IDLE,GRABBED,SEATED,WALKING,REGENERATING,FLYING} 13 | var state = STATES.NOT_STARTED 14 | 15 | var milk = 100 16 | var motion = Vector2(0,-10) 17 | var walk_motion = Vector2(10,0) 18 | var ground_y = 140 19 | 20 | func start(): 21 | state = STATES.IDLE 22 | $SwitchIdleWalkTimer.start() 23 | 24 | func _on_MouseClickBox_input_event(_viewport, event, _shape_idx): 25 | if state == STATES.NOT_STARTED: 26 | return 27 | 28 | if event is InputEventMouseButton && event.button_index == BUTTON_LEFT: 29 | if mousestate.is_idle() && event.pressed: 30 | if (state == STATES.IDLE || state == STATES.WALKING) && energy_full(): 31 | _grab() 32 | elif mousestate.is_cat_grab() && state == STATES.GRABBED && !event.pressed: 33 | _release() 34 | 35 | func _physics_process(delta): 36 | match state: 37 | STATES.GRABBED: 38 | global_position = get_global_mouse_position() 39 | global_position.y = clamp(global_position.y, 0.0, ground_y) 40 | global_position.x = clamp(global_position.x, 0.0, 100) 41 | STATES.FLYING: 42 | fly(delta) 43 | STATES.REGENERATING: 44 | milk += 30.0 * delta 45 | if milk>max_milk: 46 | milk = max_milk 47 | state = STATES.IDLE 48 | STATES.WALKING: 49 | position += walk_motion * delta 50 | animation.flip_h = walk_motion.x > 0 51 | if position.x < 0: 52 | walk_motion.x = abs(walk_motion.x) 53 | elif position.x > 100: 54 | walk_motion.x = -abs(walk_motion.x) 55 | 56 | func fly(delta): 57 | position += motion * delta 58 | 59 | if position.x <= 0: 60 | motion.x = abs(motion.x) 61 | elif position.x >= 100: 62 | motion.x = -abs(motion.x) 63 | 64 | motion.y += 100.0 * delta 65 | motion.x = lerp(motion.x, 0.0, 0.3*delta)#*= 0.99 66 | motion.y = min(motion.y, 100.0) 67 | 68 | animation.flip_h = motion.x < 0 69 | 70 | if motion.length() < 300: 71 | $Label.visible = false 72 | 73 | if motion.length() < 200: 74 | launch_particles.emitting = false 75 | else: 76 | launch_particles.emitting = true 77 | var scl = clamp((-motion.y/200.0)-1.0, 0.0, 1.0) 78 | launch_particles.process_material.scale = scl 79 | 80 | if position.y > ground_y: 81 | _land() 82 | 83 | func _land(): 84 | emit_signal("landed") 85 | animation.play("drinking") 86 | state = STATES.REGENERATING 87 | position.y = ground_y 88 | 89 | func launch(m): 90 | motion = m 91 | state = STATES.FLYING 92 | animation.play("shooting") 93 | $Label.visible = true 94 | $Label.rect_size.x = 0 95 | magnet_shape.shape.radius = 10.0 * upgrades.get_upgrade_value("magnet_strength") 96 | 97 | func set_state_seated(): 98 | state = STATES.SEATED 99 | animation.play("seated") 100 | 101 | func energy_full(): 102 | return true 103 | 104 | func _grab(): 105 | state = STATES.GRABBED 106 | animation.play("grabbed") 107 | mousestate.set_state_cat_grab() 108 | mousestate.set_held_cat(self) 109 | 110 | func _release(): 111 | motion = Vector2.ZERO 112 | state = STATES.FLYING 113 | #motion.y = 100.0 114 | mousestate.set_state_idle() 115 | 116 | func get_milk(): 117 | return milk 118 | 119 | func remove_milk(m): 120 | milk = max(0.0, milk-m) 121 | 122 | func _on_BounceArea_area_entered(area): 123 | var p = area.get_parent() 124 | # we wont allow cat to get boosted if going in at high speed 125 | if p.is_in_group("trampoline") && motion.y>-5: 126 | var bounce_angle = p.get_normal().angle()+PI*0.5 127 | 128 | motion = Vector2(0,-300).rotated(bounce_angle) * p.get_strength() 129 | # only upwards motion 130 | motion.y = -abs(motion.y) 131 | p.bounced() 132 | elif p.is_in_group("brick"): 133 | if motion.length() < 300: 134 | motion.y *= 0.2 135 | motion.x *= 0.3 136 | p.pickup() 137 | upgrades.add_money(p.get_worth()) 138 | elif p.is_in_group("cloud") && motion.length() < 300: 139 | p.hit(motion) 140 | motion.y *= 0.7 141 | elif p.is_in_group("booster") && motion.length() < 500: 142 | p.caught(self) 143 | # elif p.is_in_group("bumper"): 144 | # if motion.length() > 250: 145 | # p.destroy() 146 | # else: 147 | # var normal = (global_position-p.global_position) 148 | # motion = normal * 20.0; 149 | # p.bounced() 150 | 151 | 152 | func _on_CollectionArea_area_entered(area): 153 | var p = area.get_parent() 154 | # we wont allow cat to get boosted if going in at high speed 155 | if p.is_in_group("fish"): 156 | upgrades.add_money(p.get_worth()) 157 | p.pickup() 158 | elif p.is_in_group("milkbowl"): 159 | milk = min(100, milk+20) 160 | p.pickup() 161 | emit_signal("change_milk", milk) 162 | 163 | func add_money(m): 164 | upgrades.add_money(m) 165 | 166 | func _on_MagnetArea_area_entered(area): 167 | var p = area.get_parent() 168 | if p.is_in_group("fish"): 169 | p.magnetized(self) 170 | 171 | 172 | func _on_MagnetArea_area_exited(area): 173 | var p = area.get_parent() 174 | if p.is_in_group("fish"): 175 | p.demagnetized() 176 | 177 | 178 | func _on_SwitchIdleWalkTimer_timeout(): 179 | $SwitchIdleWalkTimer.wait_time = rand_range(0.5, 10.0) 180 | $SwitchIdleWalkTimer.start() 181 | 182 | if state == STATES.WALKING: 183 | state = STATES.IDLE 184 | animation.play("idle") 185 | elif state == STATES.IDLE: 186 | state = STATES.WALKING 187 | animation.play("walking") 188 | walk_motion.x *= sign(rand_range(-1,1)) 189 | -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/Cat.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=49 format=2] 2 | 3 | [ext_resource path="res://Game/World/Cats/Cat.gd" type="Script" id=1] 4 | [ext_resource path="res://Game/World/Cats/cat-animation.png" type="Texture" id=2] 5 | [ext_resource path="res://Game/World/Cats/cat-animation-launch.png" type="Texture" id=3] 6 | [ext_resource path="res://Game/World/Cats/launch-particles.png" type="Texture" id=4] 7 | [ext_resource path="res://Game/World/Cats/Outline.shader" type="Shader" id=5] 8 | [ext_resource path="res://Game/World/Cats/dangling.png" type="Texture" id=6] 9 | [ext_resource path="res://Game/World/Cats/cat-drinking.png" type="Texture" id=7] 10 | [ext_resource path="res://Game/World/Cats/walking.png" type="Texture" id=8] 11 | [ext_resource path="res://Game/World/Cats/cat-seated.png" type="Texture" id=9] 12 | 13 | [sub_resource type="CanvasItemMaterial" id=1] 14 | particles_animation = true 15 | particles_anim_h_frames = 7 16 | particles_anim_v_frames = 1 17 | particles_anim_loop = false 18 | 19 | [sub_resource type="Curve" id=2] 20 | _data = [ Vector2( 0, 1 ), 0.0, -1.0, 0, 1, Vector2( 1, 0 ), -1.0, 0.0, 1, 0 ] 21 | 22 | [sub_resource type="CurveTexture" id=3] 23 | curve = SubResource( 2 ) 24 | 25 | [sub_resource type="ParticlesMaterial" id=4] 26 | emission_shape = 1 27 | emission_sphere_radius = 5.0 28 | flag_disable_z = true 29 | gravity = Vector3( 0, 0, 0 ) 30 | orbit_velocity = 0.0 31 | orbit_velocity_random = 0.0 32 | scale_curve = SubResource( 3 ) 33 | anim_offset = 1.0 34 | anim_offset_random = 1.0 35 | 36 | [sub_resource type="ShaderMaterial" id=5] 37 | shader = ExtResource( 5 ) 38 | shader_param/outline_color = Color( 0.286275, 0.301961, 0.494118, 1 ) 39 | 40 | [sub_resource type="AtlasTexture" id=6] 41 | atlas = ExtResource( 2 ) 42 | region = Rect2( 0, 0, 16, 16 ) 43 | 44 | [sub_resource type="AtlasTexture" id=7] 45 | atlas = ExtResource( 2 ) 46 | region = Rect2( 16, 0, 16, 16 ) 47 | 48 | [sub_resource type="AtlasTexture" id=8] 49 | atlas = ExtResource( 2 ) 50 | region = Rect2( 32, 0, 16, 16 ) 51 | 52 | [sub_resource type="AtlasTexture" id=9] 53 | atlas = ExtResource( 2 ) 54 | region = Rect2( 48, 0, 16, 16 ) 55 | 56 | [sub_resource type="AtlasTexture" id=10] 57 | atlas = ExtResource( 2 ) 58 | region = Rect2( 64, 0, 16, 16 ) 59 | 60 | [sub_resource type="AtlasTexture" id=11] 61 | atlas = ExtResource( 2 ) 62 | region = Rect2( 80, 0, 16, 16 ) 63 | 64 | [sub_resource type="AtlasTexture" id=12] 65 | atlas = ExtResource( 2 ) 66 | region = Rect2( 96, 0, 16, 16 ) 67 | 68 | [sub_resource type="AtlasTexture" id=13] 69 | atlas = ExtResource( 2 ) 70 | region = Rect2( 112, 0, 16, 16 ) 71 | 72 | [sub_resource type="AtlasTexture" id=14] 73 | atlas = ExtResource( 2 ) 74 | region = Rect2( 128, 0, 16, 16 ) 75 | 76 | [sub_resource type="AtlasTexture" id=15] 77 | atlas = ExtResource( 2 ) 78 | region = Rect2( 144, 0, 16, 16 ) 79 | 80 | [sub_resource type="AtlasTexture" id=16] 81 | atlas = ExtResource( 2 ) 82 | region = Rect2( 160, 0, 16, 16 ) 83 | 84 | [sub_resource type="AtlasTexture" id=17] 85 | atlas = ExtResource( 2 ) 86 | region = Rect2( 176, 0, 16, 16 ) 87 | 88 | [sub_resource type="AtlasTexture" id=18] 89 | atlas = ExtResource( 2 ) 90 | region = Rect2( 192, 0, 16, 16 ) 91 | 92 | [sub_resource type="AtlasTexture" id=19] 93 | atlas = ExtResource( 2 ) 94 | region = Rect2( 208, 0, 16, 16 ) 95 | 96 | [sub_resource type="AtlasTexture" id=20] 97 | atlas = ExtResource( 2 ) 98 | region = Rect2( 224, 0, 16, 16 ) 99 | 100 | [sub_resource type="AtlasTexture" id=21] 101 | atlas = ExtResource( 8 ) 102 | region = Rect2( 0, 0, 16, 16 ) 103 | 104 | [sub_resource type="AtlasTexture" id=22] 105 | atlas = ExtResource( 8 ) 106 | region = Rect2( 16, 0, 16, 16 ) 107 | 108 | [sub_resource type="AtlasTexture" id=23] 109 | atlas = ExtResource( 8 ) 110 | region = Rect2( 32, 0, 16, 16 ) 111 | 112 | [sub_resource type="AtlasTexture" id=24] 113 | atlas = ExtResource( 6 ) 114 | region = Rect2( 0, 0, 16, 16 ) 115 | 116 | [sub_resource type="AtlasTexture" id=25] 117 | atlas = ExtResource( 6 ) 118 | region = Rect2( 16, 0, 16, 16 ) 119 | 120 | [sub_resource type="AtlasTexture" id=26] 121 | atlas = ExtResource( 6 ) 122 | region = Rect2( 32, 0, 16, 16 ) 123 | 124 | [sub_resource type="AtlasTexture" id=27] 125 | atlas = ExtResource( 6 ) 126 | region = Rect2( 48, 0, 16, 16 ) 127 | 128 | [sub_resource type="AtlasTexture" id=28] 129 | atlas = ExtResource( 7 ) 130 | region = Rect2( 0, 0, 16, 16 ) 131 | 132 | [sub_resource type="AtlasTexture" id=29] 133 | atlas = ExtResource( 7 ) 134 | region = Rect2( 16, 0, 16, 16 ) 135 | 136 | [sub_resource type="AtlasTexture" id=30] 137 | atlas = ExtResource( 3 ) 138 | region = Rect2( 0, 0, 16, 16 ) 139 | 140 | [sub_resource type="AtlasTexture" id=31] 141 | atlas = ExtResource( 3 ) 142 | region = Rect2( 16, 0, 16, 16 ) 143 | 144 | [sub_resource type="AtlasTexture" id=32] 145 | atlas = ExtResource( 3 ) 146 | region = Rect2( 32, 0, 16, 16 ) 147 | 148 | [sub_resource type="AtlasTexture" id=33] 149 | atlas = ExtResource( 3 ) 150 | region = Rect2( 48, 0, 16, 16 ) 151 | 152 | [sub_resource type="AtlasTexture" id=39] 153 | atlas = ExtResource( 9 ) 154 | region = Rect2( 0, 0, 16, 25 ) 155 | 156 | [sub_resource type="SpriteFrames" id=34] 157 | animations = [ { 158 | "frames": [ SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ) ], 159 | "loop": true, 160 | "name": "idle", 161 | "speed": 5.0 162 | }, { 163 | "frames": [ SubResource( 21 ), SubResource( 22 ), SubResource( 23 ) ], 164 | "loop": true, 165 | "name": "walking", 166 | "speed": 5.0 167 | }, { 168 | "frames": [ SubResource( 24 ), SubResource( 25 ), SubResource( 26 ), SubResource( 27 ) ], 169 | "loop": true, 170 | "name": "grabbed", 171 | "speed": 5.0 172 | }, { 173 | "frames": [ SubResource( 28 ), SubResource( 28 ), SubResource( 28 ), SubResource( 29 ) ], 174 | "loop": true, 175 | "name": "drinking", 176 | "speed": 2.0 177 | }, { 178 | "frames": [ SubResource( 30 ), SubResource( 31 ), SubResource( 32 ), SubResource( 33 ) ], 179 | "loop": true, 180 | "name": "shooting", 181 | "speed": 5.0 182 | }, { 183 | "frames": [ SubResource( 39 ) ], 184 | "loop": true, 185 | "name": "seated", 186 | "speed": 5.0 187 | } ] 188 | 189 | [sub_resource type="CircleShape2D" id=35] 190 | 191 | [sub_resource type="CircleShape2D" id=36] 192 | radius = 7.0 193 | 194 | [sub_resource type="CircleShape2D" id=37] 195 | 196 | [sub_resource type="CircleShape2D" id=38] 197 | 198 | [node name="Cat" type="Node2D"] 199 | script = ExtResource( 1 ) 200 | 201 | [node name="LaunchParticles" type="Particles2D" parent="."] 202 | material = SubResource( 1 ) 203 | emitting = false 204 | amount = 120 205 | local_coords = false 206 | process_material = SubResource( 4 ) 207 | texture = ExtResource( 4 ) 208 | 209 | [node name="AnimatedSprite" type="AnimatedSprite" parent="."] 210 | material = SubResource( 5 ) 211 | frames = SubResource( 34 ) 212 | animation = "idle" 213 | frame = 10 214 | playing = true 215 | 216 | [node name="MouseClickBox" type="Area2D" parent="."] 217 | 218 | [node name="CollisionShape2D" type="CollisionShape2D" parent="MouseClickBox"] 219 | visible = false 220 | shape = SubResource( 35 ) 221 | 222 | [node name="BounceArea" type="Area2D" parent="."] 223 | visible = false 224 | position = Vector2( -1, 1 ) 225 | collision_layer = 1024 226 | collision_mask = 1024 227 | 228 | [node name="CollisionShape2D" type="CollisionShape2D" parent="BounceArea"] 229 | shape = SubResource( 36 ) 230 | 231 | [node name="CollectionArea" type="Area2D" parent="."] 232 | visible = false 233 | collision_layer = 2048 234 | collision_mask = 2048 235 | 236 | [node name="CollisionShape2D" type="CollisionShape2D" parent="CollectionArea"] 237 | position = Vector2( -1, 1 ) 238 | shape = SubResource( 37 ) 239 | 240 | [node name="MagnetArea" type="Area2D" parent="."] 241 | visible = false 242 | collision_layer = 2048 243 | collision_mask = 2048 244 | 245 | [node name="CollisionShape2D" type="CollisionShape2D" parent="MagnetArea"] 246 | position = Vector2( -1, 1 ) 247 | shape = SubResource( 38 ) 248 | 249 | [node name="SwitchIdleWalkTimer" type="Timer" parent="."] 250 | one_shot = true 251 | autostart = true 252 | [connection signal="input_event" from="MouseClickBox" to="." method="_on_MouseClickBox_input_event"] 253 | [connection signal="area_entered" from="BounceArea" to="." method="_on_BounceArea_area_entered"] 254 | [connection signal="area_entered" from="CollectionArea" to="." method="_on_CollectionArea_area_entered"] 255 | [connection signal="area_entered" from="MagnetArea" to="." method="_on_MagnetArea_area_entered"] 256 | [connection signal="area_exited" from="MagnetArea" to="." method="_on_MagnetArea_area_exited"] 257 | [connection signal="timeout" from="SwitchIdleWalkTimer" to="." method="_on_SwitchIdleWalkTimer_timeout"] 258 | -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/Cat.tscn.tmp: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=47 format=2] 2 | 3 | [ext_resource path="res://Game/World/Cats/Cat.gd" type="Script" id=1] 4 | [ext_resource path="res://Game/World/Cats/cat-animation.png" type="Texture" id=2] 5 | [ext_resource path="res://Game/World/Cats/launch-particles.png" type="Texture" id=4] 6 | [ext_resource path="res://Game/World/Cats/Outline.shader" type="Shader" id=5] 7 | [ext_resource path="res://Game/World/Cats/dangling.png" type="Texture" id=6] 8 | [ext_resource path="res://Game/World/Cats/cat-drinking.png" type="Texture" id=7] 9 | [ext_resource path="res://Game/World/Cats/walking.png" type="Texture" id=8] 10 | 11 | [sub_resource type="CanvasItemMaterial" id=1] 12 | particles_animation = true 13 | particles_anim_h_frames = 7 14 | particles_anim_v_frames = 1 15 | particles_anim_loop = false 16 | 17 | [sub_resource type="Curve" id=2] 18 | _data = [ Vector2( 0, 1 ), 0.0, -1.0, 0, 1, Vector2( 1, 0 ), -1.0, 0.0, 1, 0 ] 19 | 20 | [sub_resource type="CurveTexture" id=3] 21 | curve = SubResource( 2 ) 22 | 23 | [sub_resource type="ParticlesMaterial" id=4] 24 | emission_shape = 1 25 | emission_sphere_radius = 5.0 26 | flag_disable_z = true 27 | gravity = Vector3( 0, 0, 0 ) 28 | orbit_velocity = 0.0 29 | orbit_velocity_random = 0.0 30 | scale_curve = SubResource( 3 ) 31 | anim_offset = 1.0 32 | anim_offset_random = 1.0 33 | 34 | [sub_resource type="ShaderMaterial" id=5] 35 | shader = ExtResource( 5 ) 36 | shader_param/outline_color = Color( 0.286275, 0.301961, 0.494118, 1 ) 37 | 38 | [sub_resource type="AtlasTexture" id=6] 39 | atlas = ExtResource( 2 ) 40 | region = Rect2( 0, 0, 16, 16 ) 41 | 42 | [sub_resource type="AtlasTexture" id=7] 43 | atlas = ExtResource( 2 ) 44 | region = Rect2( 16, 0, 16, 16 ) 45 | 46 | [sub_resource type="AtlasTexture" id=8] 47 | atlas = ExtResource( 2 ) 48 | region = Rect2( 32, 0, 16, 16 ) 49 | 50 | [sub_resource type="AtlasTexture" id=9] 51 | atlas = ExtResource( 2 ) 52 | region = Rect2( 48, 0, 16, 16 ) 53 | 54 | [sub_resource type="AtlasTexture" id=10] 55 | atlas = ExtResource( 2 ) 56 | region = Rect2( 64, 0, 16, 16 ) 57 | 58 | [sub_resource type="AtlasTexture" id=11] 59 | atlas = ExtResource( 2 ) 60 | region = Rect2( 80, 0, 16, 16 ) 61 | 62 | [sub_resource type="AtlasTexture" id=12] 63 | atlas = ExtResource( 2 ) 64 | region = Rect2( 96, 0, 16, 16 ) 65 | 66 | [sub_resource type="AtlasTexture" id=13] 67 | atlas = ExtResource( 2 ) 68 | region = Rect2( 112, 0, 16, 16 ) 69 | 70 | [sub_resource type="AtlasTexture" id=14] 71 | atlas = ExtResource( 2 ) 72 | region = Rect2( 128, 0, 16, 16 ) 73 | 74 | [sub_resource type="AtlasTexture" id=15] 75 | atlas = ExtResource( 2 ) 76 | region = Rect2( 144, 0, 16, 16 ) 77 | 78 | [sub_resource type="AtlasTexture" id=16] 79 | atlas = ExtResource( 2 ) 80 | region = Rect2( 160, 0, 16, 16 ) 81 | 82 | [sub_resource type="AtlasTexture" id=17] 83 | atlas = ExtResource( 2 ) 84 | region = Rect2( 176, 0, 16, 16 ) 85 | 86 | [sub_resource type="AtlasTexture" id=18] 87 | atlas = ExtResource( 2 ) 88 | region = Rect2( 192, 0, 16, 16 ) 89 | 90 | [sub_resource type="AtlasTexture" id=19] 91 | atlas = ExtResource( 2 ) 92 | region = Rect2( 208, 0, 16, 16 ) 93 | 94 | [sub_resource type="AtlasTexture" id=20] 95 | atlas = ExtResource( 2 ) 96 | region = Rect2( 224, 0, 16, 16 ) 97 | 98 | [sub_resource type="AtlasTexture" id=21] 99 | atlas = ExtResource( 8 ) 100 | region = Rect2( 0, 0, 16, 16 ) 101 | 102 | [sub_resource type="AtlasTexture" id=22] 103 | atlas = ExtResource( 8 ) 104 | region = Rect2( 16, 0, 16, 16 ) 105 | 106 | [sub_resource type="AtlasTexture" id=23] 107 | atlas = ExtResource( 8 ) 108 | region = Rect2( 32, 0, 16, 16 ) 109 | 110 | [sub_resource type="AtlasTexture" id=30] 111 | atlas = ExtResource( 6 ) 112 | region = Rect2( 32, 0, 16, 16 ) 113 | 114 | [sub_resource type="AtlasTexture" id=31] 115 | atlas = ExtResource( 6 ) 116 | region = Rect2( 48, 0, 16, 16 ) 117 | 118 | [sub_resource type="AtlasTexture" id=32] 119 | atlas = ExtResource( 7 ) 120 | region = Rect2( 0, 0, 16, 16 ) 121 | 122 | [sub_resource type="AtlasTexture" id=33] 123 | atlas = ExtResource( 7 ) 124 | region = Rect2( 16, 0, 16, 16 ) 125 | 126 | [sub_resource type="AtlasTexture" id=40] 127 | atlas = ExtResource( 6 ) 128 | region = Rect2( 0, 0, 16, 16 ) 129 | 130 | [sub_resource type="AtlasTexture" id=41] 131 | atlas = ExtResource( 6 ) 132 | region = Rect2( 16, 0, 16, 16 ) 133 | 134 | [sub_resource type="AtlasTexture" id=42] 135 | atlas = ExtResource( 6 ) 136 | region = Rect2( 32, 0, 16, 16 ) 137 | 138 | [sub_resource type="AtlasTexture" id=43] 139 | atlas = ExtResource( 6 ) 140 | region = Rect2( 48, 0, 16, 16 ) 141 | 142 | [sub_resource type="AtlasTexture" id=44] 143 | atlas = ExtResource( 7 ) 144 | region = Rect2( 0, 0, 16, 16 ) 145 | 146 | [sub_resource type="AtlasTexture" id=45] 147 | atlas = ExtResource( 7 ) 148 | region = Rect2( 16, 0, 16, 16 ) 149 | 150 | [sub_resource type="AtlasTexture" id=39] 151 | atlas = ExtResource( 7 ) 152 | region = Rect2( 16, 0, 16, 16 ) 153 | 154 | [sub_resource type="SpriteFrames" id=46] 155 | animations = [ { 156 | "frames": [ SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ) ], 157 | "loop": true, 158 | "name": "idle", 159 | "speed": 5.0 160 | }, { 161 | "frames": [ SubResource( 21 ), SubResource( 22 ), SubResource( 23 ) ], 162 | "loop": true, 163 | "name": "walking", 164 | "speed": 5.0 165 | }, { 166 | "frames": [ SubResource( 30 ), SubResource( 31 ), SubResource( 32 ), SubResource( 33 ) ], 167 | "loop": true, 168 | "name": "shooting", 169 | "speed": 5.0 170 | }, { 171 | "frames": [ SubResource( 40 ), SubResource( 41 ), SubResource( 42 ), SubResource( 43 ) ], 172 | "loop": true, 173 | "name": "grabbed", 174 | "speed": 5.0 175 | }, { 176 | "frames": [ SubResource( 44 ), SubResource( 44 ), SubResource( 44 ), SubResource( 45 ) ], 177 | "loop": true, 178 | "name": "drinking", 179 | "speed": 2.0 180 | }, { 181 | "frames": [ SubResource( 39 ) ], 182 | "loop": true, 183 | "name": "seated", 184 | "speed": 5.0 185 | } ] 186 | 187 | [sub_resource type="CircleShape2D" id=47] 188 | 189 | [sub_resource type="CircleShape2D" id=48] 190 | radius = 7.0 191 | 192 | [sub_resource type="CircleShape2D" id=49] 193 | 194 | [sub_resource type="CircleShape2D" id=50] 195 | 196 | [node name="Cat" type="Node2D"] 197 | script = ExtResource( 1 ) 198 | 199 | [node name="LaunchParticles" type="Particles2D" parent="."] 200 | material = SubResource( 1 ) 201 | emitting = false 202 | amount = 120 203 | local_coords = false 204 | process_material = SubResource( 4 ) 205 | texture = ExtResource( 4 ) 206 | 207 | [node name="AnimatedSprite" type="AnimatedSprite" parent="."] 208 | material = SubResource( 5 ) 209 | frames = SubResource( 46 ) 210 | animation = "idle" 211 | frame = 3 212 | playing = true 213 | 214 | [node name="MouseClickBox" type="Area2D" parent="."] 215 | 216 | [node name="CollisionShape2D" type="CollisionShape2D" parent="MouseClickBox"] 217 | visible = false 218 | shape = SubResource( 47 ) 219 | 220 | [node name="BounceArea" type="Area2D" parent="."] 221 | visible = false 222 | position = Vector2( -1, 1 ) 223 | collision_layer = 1024 224 | collision_mask = 1024 225 | 226 | [node name="CollisionShape2D" type="CollisionShape2D" parent="BounceArea"] 227 | shape = SubResource( 48 ) 228 | 229 | [node name="CollectionArea" type="Area2D" parent="."] 230 | visible = false 231 | collision_layer = 2048 232 | collision_mask = 2048 233 | 234 | [node name="CollisionShape2D" type="CollisionShape2D" parent="CollectionArea"] 235 | position = Vector2( -1, 1 ) 236 | shape = SubResource( 49 ) 237 | 238 | [node name="MagnetArea" type="Area2D" parent="."] 239 | visible = false 240 | collision_layer = 2048 241 | collision_mask = 2048 242 | 243 | [node name="CollisionShape2D" type="CollisionShape2D" parent="MagnetArea"] 244 | position = Vector2( -1, 1 ) 245 | shape = SubResource( 50 ) 246 | 247 | [node name="SwitchIdleWalkTimer" type="Timer" parent="."] 248 | one_shot = true 249 | autostart = true 250 | [connection signal="input_event" from="MouseClickBox" to="." method="_on_MouseClickBox_input_event"] 251 | [connection signal="area_entered" from="BounceArea" to="." method="_on_BounceArea_area_entered"] 252 | [connection signal="area_entered" from="CollectionArea" to="." method="_on_CollectionArea_area_entered"] 253 | [connection signal="area_entered" from="MagnetArea" to="." method="_on_MagnetArea_area_entered"] 254 | [connection signal="area_exited" from="MagnetArea" to="." method="_on_MagnetArea_area_exited"] 255 | [connection signal="timeout" from="SwitchIdleWalkTimer" to="." method="_on_SwitchIdleWalkTimer_timeout"] 256 | -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/Olin/Olin.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Game/World/Cats/Cat.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://Game/GUI/Theme.tres" type="Theme" id=2] 5 | 6 | [node name="Cat" instance=ExtResource( 1 )] 7 | 8 | [node name="AnimatedSprite" parent="." index="1"] 9 | frame = 5 10 | flip_h = true 11 | 12 | [node name="Label" type="Label" parent="." index="2"] 13 | visible = false 14 | margin_left = -19.0 15 | margin_top = -19.0 16 | margin_right = 18.0 17 | margin_bottom = -10.0 18 | size_flags_horizontal = 13 19 | size_flags_vertical = 1 20 | theme = ExtResource( 2 ) 21 | text = "WOohoo!" 22 | __meta__ = { 23 | "_edit_use_anchors_": false 24 | } 25 | 26 | [node name="SwitchIdleWalkTimer" parent="." index="7"] 27 | wait_time = 10.0 28 | autostart = false 29 | -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/Outline.shader: -------------------------------------------------------------------------------- 1 | shader_type canvas_item; 2 | render_mode blend_mix; 3 | 4 | uniform vec4 outline_color : hint_color; 5 | const float delta = 0.01; 6 | 7 | void fragment() { 8 | vec4 col = texture(TEXTURE, UV); 9 | if (col.a < delta) { 10 | col.a += texture(TEXTURE, UV+vec2(TEXTURE_PIXEL_SIZE.x, 0.0)).a; 11 | col.a += texture(TEXTURE, UV+vec2(-TEXTURE_PIXEL_SIZE.x, 0.0)).a; 12 | col.a += texture(TEXTURE, UV+vec2(0.0, TEXTURE_PIXEL_SIZE.y)).a; 13 | col.a += texture(TEXTURE, UV+vec2(0.0, -TEXTURE_PIXEL_SIZE.y)).a; 14 | col.a = step(delta, col.a); 15 | col.rgb = outline_color.rgb; 16 | } 17 | 18 | COLOR = col; 19 | } -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/cat-animation-launch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/Cats/cat-animation-launch.png -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/cat-animation-launch.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/cat-animation-launch.png-b170641298e41dc9cc42b45bf48b01c9.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/Cats/cat-animation-launch.png" 13 | dest_files=[ "res://.import/cat-animation-launch.png-b170641298e41dc9cc42b45bf48b01c9.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/cat-animation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/Cats/cat-animation.png -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/cat-animation.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/cat-animation.png-f6321c985f803790b76ad23de0863f75.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/Cats/cat-animation.png" 13 | dest_files=[ "res://.import/cat-animation.png-f6321c985f803790b76ad23de0863f75.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/cat-drinking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/Cats/cat-drinking.png -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/cat-drinking.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/cat-drinking.png-17654e7d0eaa7673be2f8d7c1b32d5db.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/Cats/cat-drinking.png" 13 | dest_files=[ "res://.import/cat-drinking.png-17654e7d0eaa7673be2f8d7c1b32d5db.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/cat-seated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/Cats/cat-seated.png -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/cat-seated.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/cat-seated.png-024cd8e069fc47104eca2b3ee585784c.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/Cats/cat-seated.png" 13 | dest_files=[ "res://.import/cat-seated.png-024cd8e069fc47104eca2b3ee585784c.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/Cats/cat.png -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/cat.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/cat.png-590079a9461915aa78320ee5aa55d816.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/Cats/cat.png" 13 | dest_files=[ "res://.import/cat.png-590079a9461915aa78320ee5aa55d816.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/dangling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/Cats/dangling.png -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/dangling.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/dangling.png-ec0a2a682504dc7ad0a94ad913ba2290.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/Cats/dangling.png" 13 | dest_files=[ "res://.import/dangling.png-ec0a2a682504dc7ad0a94ad913ba2290.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/launch-particles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/Cats/launch-particles.png -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/launch-particles.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/launch-particles.png-37fb1510d8f3a2191618de85ba51c68b.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/Cats/launch-particles.png" 13 | dest_files=[ "res://.import/launch-particles.png-37fb1510d8f3a2191618de85ba51c68b.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/walking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/Cats/walking.png -------------------------------------------------------------------------------- /Catapult/Game/World/Cats/walking.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/walking.png-1944665c6a9ae2070403ec512ac57654.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/Cats/walking.png" 13 | dest_files=[ "res://.import/walking.png-1944665c6a9ae2070403ec512ac57654.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/LaunchStuffSpawner.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | onready var upgrades = get_tree().root.get_node("/root/UnlockedUpgrades") 4 | onready var milk_bowl = preload("res://Game/World/StuffSpawner/Stuff/MilkBowl/MilkBowl.tscn") 5 | onready var money_fish = preload("res://Game/World/StuffSpawner/Stuff/MoneyFish/MoneyFish.tscn") 6 | onready var money_worth_3 = preload("res://Game/GUI/fish2.png") 7 | onready var money_worth_5 = preload("res://Game/GUI/fish1.png") 8 | onready var sound_worth_3 = preload("res://Game/World/StuffSpawner/Stuff/MoneyFish/fish1.wav") 9 | onready var sound_worth_5 = preload("res://Game/World/StuffSpawner/Stuff/MoneyFish/fish3.wav") 10 | onready var bumper = preload("res://Game/World/StuffSpawner/Stuff/Bumper/Bumper.tscn") 11 | onready var brick = preload("res://Game/World/StuffSpawner/Stuff/Brick/Brick.tscn") 12 | onready var cloud = preload("res://Game/World/StuffSpawner/Stuff/Clouds/Cloud.tscn") 13 | onready var booster = preload("res://Game/World/StuffSpawner/Stuff/Booster/Booster.tscn") 14 | 15 | const screen_height = 150 16 | const screen_width = 100 17 | const moon_height = 15000.0 18 | enum STATES {IDLE, ACTIVE} 19 | var state = STATES.IDLE 20 | 21 | var previous_height = screen_height*.5 22 | var money_chance = 0 23 | var milk_chance = 0 24 | 25 | var height_since_cloud_spawn = 0 26 | var height_since_brick_spawn = 0 27 | var height_since_booster_spawn = 0 28 | 29 | func go_active(): 30 | state = STATES.ACTIVE 31 | money_chance = upgrades.get_upgrade_value("money_spawn_chance") 32 | milk_chance = upgrades.get_upgrade_value("milk_spawn_chance") 33 | 34 | func go_idle(): 35 | state = STATES.IDLE 36 | for c in get_children(): 37 | c.queue_free() 38 | 39 | func _random_stuff_position(height_diff = 0): 40 | return Vector2(rand_range(5.0, screen_height-5.0), -screen_height - rand_range(0.0, height_diff)) 41 | 42 | func _on_Camera2D_change_height(h): 43 | 44 | if state == STATES.ACTIVE: 45 | var height_normal = -h/moon_height 46 | 47 | var diff = h-previous_height 48 | previous_height = h 49 | height_since_brick_spawn += abs(diff) 50 | height_since_cloud_spawn += abs(diff) 51 | height_since_booster_spawn += abs(diff) 52 | for i in int(ceil(abs(diff))): 53 | if rand_range(0.0, 1.0) < money_chance: 54 | call_deferred("_spawn_money",diff,h) 55 | if rand_range(0.0, 1.0) < milk_chance: 56 | call_deferred("_spawn_milk", diff, h) 57 | 58 | if h < -200 && height_since_booster_spawn > 200 && rand_range(0.0, 1.0) < 0.01: 59 | _spawn_booster(h) 60 | 61 | if h < -800 && height_since_cloud_spawn > 100 && rand_range(0.0, 1.0) < (0.01 + height_normal*0.03): 62 | _spawn_cloud(h) 63 | 64 | if h < -1500 && height_since_brick_spawn > 500 && rand_range(0.0, 1.0) < (0.01 + height_normal*0.03): 65 | _spawn_brick_group(h) 66 | #_spawn_bumper_group(h, randi()%2+3) 67 | 68 | func _spawn_booster(height): 69 | height_since_booster_spawn = 0 70 | var b = booster.instance() 71 | b.position = Vector2(0,height)-Vector2(0,200)+_random_stuff_position() 72 | add_child(b) 73 | 74 | func _spawn_cloud(height): 75 | height_since_cloud_spawn = 0 76 | var c = cloud.instance() 77 | c.position = Vector2(0,height)-Vector2(0,200)+_random_stuff_position() 78 | add_child(c) 79 | 80 | 81 | func _spawn_milk(diff, height): 82 | var pos = Vector2(0,height)+_random_stuff_position(diff) 83 | var m = milk_bowl.instance() 84 | m.position = pos 85 | add_child(m) 86 | 87 | func _spawn_brick_group(height): 88 | height_since_brick_spawn = 0 89 | if rand_range(0.0, 1.0) > 0.5: 90 | _spawn_closed_brick_group(height) 91 | else: 92 | _spawn_open_brick_group(height) 93 | 94 | func _spawn_open_brick_group(height): 95 | for y in randi()%2+1: 96 | for x in 3: 97 | var b = brick.instance() 98 | b.position = Vector2(40*x, height + 7*y) + Vector2(20*y, -200) 99 | add_child(b) 100 | 101 | func _spawn_closed_brick_group(height): 102 | for x in 5: 103 | var b = brick.instance() 104 | b.position = Vector2(20*x, height -200) 105 | add_child(b) 106 | 107 | func _spawn_bumper_group(height, amount): 108 | var center_pos = Vector2(rand_range(10.0, screen_width-10.0),height-200) 109 | var distance = rand_range(10.0, 30.0) 110 | for i in amount: 111 | var divider =float(i+1)/float(amount) 112 | var pos = center_pos + Vector2(distance,0).rotated((PI)/divider) 113 | var b = bumper.instance() 114 | b.position = pos 115 | add_child(b) 116 | 117 | func _spawn_money(diff, height): 118 | var pos = Vector2(0,height)+_random_stuff_position(diff) 119 | var m = money_fish.instance() 120 | m.position = pos 121 | 122 | if (rand_range(0.0,1.0) < -height/8000.0): 123 | m.set_worth(3) 124 | m.set_texture(money_worth_3) 125 | m.set_sound(sound_worth_3) 126 | if (rand_range(0.0,1.0) < -height/25000.0): 127 | m.set_worth(5) 128 | m.set_texture(money_worth_5) 129 | m.set_sound(sound_worth_5) 130 | 131 | add_child(m) 132 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/LaunchStuffSpawner.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Game/World/StuffSpawner/LaunchStuffSpawner.gd" type="Script" id=1] 4 | 5 | [node name="LaunchStuffSpawner" type="Node2D"] 6 | script = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/BaseStuff.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | export (int) var worth = 1 4 | 5 | func set_worth(w): 6 | worth = w 7 | 8 | func get_worth(): 9 | return worth 10 | 11 | func pickup(): 12 | $DespawnTimer.start() 13 | $Label.visible = true 14 | $Label.text ="+"+String(worth) 15 | $Sprite.visible = false 16 | $Tween.interpolate_property($Label, "rect_position", $Label.rect_position, $Label.rect_position-Vector2(0,10), 0.5, Tween.TRANS_LINEAR, Tween.EASE_IN) 17 | $Tween.start() 18 | _on_pickup() 19 | $AudioStreamPlayer2D.play() 20 | 21 | func _on_pickup(): 22 | pass 23 | 24 | func _on_DespawnTimer_timeout(): 25 | queue_free() 26 | 27 | 28 | func _on_VisibilityEnabler2D_screen_exited(): 29 | queue_free() 30 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/BaseStuff.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/BaseStuff.gd" type="Script" id=1] 4 | [ext_resource path="res://slkscre.ttf" type="DynamicFontData" id=2] 5 | 6 | [sub_resource type="DynamicFont" id=1] 7 | size = 8 8 | outline_size = 1 9 | outline_color = Color( 0.152941, 0.152941, 0.266667, 1 ) 10 | extra_spacing_char = -2 11 | font_data = ExtResource( 2 ) 12 | 13 | [node name="BaseStuff" type="Node2D"] 14 | script = ExtResource( 1 ) 15 | 16 | [node name="Label" type="Label" parent="."] 17 | visible = false 18 | margin_right = 40.0 19 | margin_bottom = 14.0 20 | custom_fonts/font = SubResource( 1 ) 21 | custom_colors/font_color = Color( 0.984314, 0.960784, 0.937255, 1 ) 22 | text = "+15" 23 | __meta__ = { 24 | "_edit_use_anchors_": false 25 | } 26 | 27 | [node name="Tween" type="Tween" parent="."] 28 | 29 | [node name="DespawnTimer" type="Timer" parent="."] 30 | one_shot = true 31 | 32 | [node name="VisibilityEnabler2D" type="VisibilityEnabler2D" parent="."] 33 | rect = Rect2( -10, -10, 20, 200 ) 34 | 35 | [node name="Sprite" type="Sprite" parent="."] 36 | 37 | [node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] 38 | bus = "sound" 39 | [connection signal="timeout" from="DespawnTimer" to="." method="_on_DespawnTimer_timeout"] 40 | [connection signal="screen_exited" from="VisibilityEnabler2D" to="." method="_on_VisibilityEnabler2D_screen_exited"] 41 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Booster/Booster.gd: -------------------------------------------------------------------------------- 1 | extends "res://Game/World/StuffSpawner/Stuff/BaseStuff.gd" 2 | 3 | enum states {IDLE, CAUGHT} 4 | var state = states.IDLE 5 | var catch_speed = Vector2.ZERO 6 | var caught_cat = null 7 | 8 | func caught(cat): 9 | state = states.CAUGHT 10 | catch_speed = cat.motion 11 | caught_cat = cat 12 | cat.motion = Vector2.ZERO 13 | $BoostTimer.start() 14 | $AddMoney.start() 15 | $AnimatedSprite.play("charge") 16 | $AudioStreamPlayer2D.play() 17 | 18 | func _physics_process(_delta): 19 | if state == states.CAUGHT && caught_cat != null: 20 | caught_cat.position = position 21 | 22 | func _on_BoostTimer_timeout(): 23 | state = states.IDLE 24 | var new_motion = catch_speed.normalized() 25 | new_motion.y = -1 26 | new_motion *= 400 27 | caught_cat.motion = new_motion 28 | caught_cat = null 29 | $Launch.play() 30 | $AnimatedSprite.play("idle") 31 | 32 | 33 | func _on_AddMoney_timeout(): 34 | if state == states.CAUGHT && caught_cat != null: 35 | caught_cat.add_money(1) 36 | $AddMoney.start() 37 | var l = $Label.duplicate() 38 | l.text = "+ 1" 39 | l.visible = true 40 | add_child(l) 41 | var start_pos = l.rect_position + Vector2(rand_range(-15, 5),rand_range(-5, 5)) 42 | $Tween.interpolate_property(l, "rect_position", start_pos, start_pos-Vector2(0,10), 0.5, Tween.TRANS_LINEAR, Tween.EASE_IN) 43 | $Tween.start() 44 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Booster/Booster.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=24 format=2] 2 | 3 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/BaseStuff.tscn" type="PackedScene" id=1] 4 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/Booster/booster.png" type="Texture" id=2] 5 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/Booster/Booster.gd" type="Script" id=3] 6 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/Booster/booster.wav" type="AudioStream" id=4] 7 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/Booster/launch.wav" type="AudioStream" id=5] 8 | 9 | [sub_resource type="AtlasTexture" id=1] 10 | atlas = ExtResource( 2 ) 11 | region = Rect2( 0, 0, 16, 16 ) 12 | 13 | [sub_resource type="AtlasTexture" id=2] 14 | atlas = ExtResource( 2 ) 15 | region = Rect2( 16, 0, 16, 16 ) 16 | 17 | [sub_resource type="AtlasTexture" id=3] 18 | atlas = ExtResource( 2 ) 19 | region = Rect2( 32, 0, 16, 16 ) 20 | 21 | [sub_resource type="AtlasTexture" id=4] 22 | atlas = ExtResource( 2 ) 23 | region = Rect2( 48, 0, 16, 16 ) 24 | 25 | [sub_resource type="AtlasTexture" id=5] 26 | atlas = ExtResource( 2 ) 27 | region = Rect2( 64, 0, 16, 16 ) 28 | 29 | [sub_resource type="AtlasTexture" id=6] 30 | atlas = ExtResource( 2 ) 31 | region = Rect2( 80, 0, 16, 16 ) 32 | 33 | [sub_resource type="AtlasTexture" id=7] 34 | atlas = ExtResource( 2 ) 35 | region = Rect2( 96, 0, 16, 16 ) 36 | 37 | [sub_resource type="AtlasTexture" id=8] 38 | atlas = ExtResource( 2 ) 39 | region = Rect2( 112, 0, 16, 16 ) 40 | 41 | [sub_resource type="AtlasTexture" id=9] 42 | atlas = ExtResource( 2 ) 43 | region = Rect2( 48, 0, 16, 16 ) 44 | 45 | [sub_resource type="AtlasTexture" id=10] 46 | atlas = ExtResource( 2 ) 47 | region = Rect2( 32, 0, 16, 16 ) 48 | 49 | [sub_resource type="AtlasTexture" id=11] 50 | atlas = ExtResource( 2 ) 51 | region = Rect2( 16, 0, 16, 16 ) 52 | 53 | [sub_resource type="AtlasTexture" id=12] 54 | atlas = ExtResource( 2 ) 55 | region = Rect2( 0, 0, 16, 16 ) 56 | 57 | [sub_resource type="AtlasTexture" id=13] 58 | atlas = ExtResource( 2 ) 59 | region = Rect2( 112, 0, 16, 16 ) 60 | 61 | [sub_resource type="AtlasTexture" id=14] 62 | atlas = ExtResource( 2 ) 63 | region = Rect2( 96, 0, 16, 16 ) 64 | 65 | [sub_resource type="AtlasTexture" id=15] 66 | atlas = ExtResource( 2 ) 67 | region = Rect2( 80, 0, 16, 16 ) 68 | 69 | [sub_resource type="AtlasTexture" id=16] 70 | atlas = ExtResource( 2 ) 71 | region = Rect2( 64, 0, 16, 16 ) 72 | 73 | [sub_resource type="SpriteFrames" id=17] 74 | animations = [ { 75 | "frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ) ], 76 | "loop": true, 77 | "name": "idle", 78 | "speed": 5.0 79 | }, { 80 | "frames": [ SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ) ], 81 | "loop": true, 82 | "name": "charge", 83 | "speed": 15.0 84 | } ] 85 | 86 | [sub_resource type="CircleShape2D" id=18] 87 | radius = 8.0 88 | 89 | [node name="Booster" groups=[ 90 | "booster", 91 | ] instance=ExtResource( 1 )] 92 | script = ExtResource( 3 ) 93 | 94 | [node name="AnimatedSprite" type="AnimatedSprite" parent="." index="5"] 95 | z_index = -1 96 | z_as_relative = false 97 | frames = SubResource( 17 ) 98 | animation = "idle" 99 | frame = 4 100 | playing = true 101 | 102 | [node name="Area2D" type="Area2D" parent="." index="6"] 103 | collision_layer = 1024 104 | collision_mask = 1024 105 | 106 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" index="0"] 107 | shape = SubResource( 18 ) 108 | 109 | [node name="BoostTimer" type="Timer" parent="." index="7"] 110 | one_shot = true 111 | 112 | [node name="AddMoney" type="Timer" parent="." index="8"] 113 | wait_time = 0.05 114 | one_shot = true 115 | 116 | [node name="AudioStreamPlayer2D" parent="." index="9"] 117 | stream = ExtResource( 4 ) 118 | 119 | [node name="Launch" type="AudioStreamPlayer2D" parent="." index="10"] 120 | stream = ExtResource( 5 ) 121 | volume_db = 10.0 122 | bus = "sound" 123 | [connection signal="timeout" from="BoostTimer" to="." method="_on_BoostTimer_timeout"] 124 | [connection signal="timeout" from="AddMoney" to="." method="_on_AddMoney_timeout"] 125 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Booster/booster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/StuffSpawner/Stuff/Booster/booster.png -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Booster/booster.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/booster.png-e5baa1b2ef47b7e03c6b815533efd6e5.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/StuffSpawner/Stuff/Booster/booster.png" 13 | dest_files=[ "res://.import/booster.png-e5baa1b2ef47b7e03c6b815533efd6e5.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Booster/booster.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/StuffSpawner/Stuff/Booster/booster.wav -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Booster/booster.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/booster.wav-272598026e0cf43e212ec2b92c7ba765.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://Game/World/StuffSpawner/Stuff/Booster/booster.wav" 10 | dest_files=[ "res://.import/booster.wav-272598026e0cf43e212ec2b92c7ba765.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Booster/launch.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/StuffSpawner/Stuff/Booster/launch.wav -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Booster/launch.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/launch.wav-5ca6841bb1d2b9500a3dbb614d796cd9.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://Game/World/StuffSpawner/Stuff/Booster/launch.wav" 10 | dest_files=[ "res://.import/launch.wav-5ca6841bb1d2b9500a3dbb614d796cd9.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Brick/Brick.gd: -------------------------------------------------------------------------------- 1 | extends "res://Game/World/StuffSpawner/Stuff/BaseStuff.gd" 2 | 3 | 4 | func _on_pickup(): 5 | $Particles2D.emitting = true 6 | $Area2D/CollisionShape2D.set_deferred("disabled", true) 7 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Brick/Brick.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=9 format=2] 2 | 3 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/Brick/brick.png" type="Texture" id=1] 4 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/Brick/Brick.gd" type="Script" id=2] 5 | [ext_resource path="res://slkscre.ttf" type="DynamicFontData" id=3] 6 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/Brick/mixkit-electronic-retro-block-hit-2185.wav" type="AudioStream" id=4] 7 | 8 | [sub_resource type="RectangleShape2D" id=1] 9 | extents = Vector2( 10, 3.5 ) 10 | 11 | [sub_resource type="DynamicFont" id=2] 12 | size = 8 13 | outline_size = 1 14 | outline_color = Color( 0.152941, 0.152941, 0.266667, 1 ) 15 | use_mipmaps = true 16 | extra_spacing_char = -2 17 | font_data = ExtResource( 3 ) 18 | 19 | [sub_resource type="ParticlesMaterial" id=3] 20 | emission_shape = 2 21 | emission_box_extents = Vector3( 10, 3.5, 1 ) 22 | flag_disable_z = true 23 | direction = Vector3( 0, -1, 0 ) 24 | gravity = Vector3( 0, 60, 0 ) 25 | initial_velocity = 44.2 26 | initial_velocity_random = 0.7 27 | orbit_velocity = 0.0 28 | orbit_velocity_random = 0.0 29 | color = Color( 0.545098, 0.427451, 0.611765, 1 ) 30 | 31 | [sub_resource type="AudioStreamRandomPitch" id=4] 32 | audio_stream = ExtResource( 4 ) 33 | random_pitch = 1.03 34 | 35 | [node name="Brick" type="Node2D" groups=[ 36 | "brick", 37 | ]] 38 | script = ExtResource( 2 ) 39 | worth = 15 40 | 41 | [node name="Sprite" type="Sprite" parent="."] 42 | texture = ExtResource( 1 ) 43 | centered = false 44 | 45 | [node name="Area2D" type="Area2D" parent="."] 46 | collision_layer = 1024 47 | collision_mask = 1024 48 | 49 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] 50 | position = Vector2( 10, 3.5 ) 51 | shape = SubResource( 1 ) 52 | 53 | [node name="Label" type="Label" parent="."] 54 | visible = false 55 | margin_right = 40.0 56 | margin_bottom = 14.0 57 | custom_fonts/font = SubResource( 2 ) 58 | custom_colors/font_color = Color( 0.984314, 0.960784, 0.937255, 1 ) 59 | text = "+15" 60 | __meta__ = { 61 | "_edit_use_anchors_": false 62 | } 63 | 64 | [node name="Tween" type="Tween" parent="."] 65 | 66 | [node name="DespawnTimer" type="Timer" parent="."] 67 | one_shot = true 68 | 69 | [node name="Particles2D" type="Particles2D" parent="."] 70 | position = Vector2( 10, 3.5 ) 71 | emitting = false 72 | amount = 10 73 | one_shot = true 74 | explosiveness = 0.9 75 | randomness = 1.0 76 | process_material = SubResource( 3 ) 77 | 78 | [node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] 79 | stream = SubResource( 4 ) 80 | volume_db = 10.0 81 | bus = "sound" 82 | [connection signal="timeout" from="DespawnTimer" to="." method="_on_DespawnTimer_timeout"] 83 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Brick/brick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/StuffSpawner/Stuff/Brick/brick.png -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Brick/brick.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/brick.png-962174f4074160eda789587cf6c82029.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/StuffSpawner/Stuff/Brick/brick.png" 13 | dest_files=[ "res://.import/brick.png-962174f4074160eda789587cf6c82029.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Brick/mixkit-electronic-retro-block-hit-2185.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/StuffSpawner/Stuff/Brick/mixkit-electronic-retro-block-hit-2185.wav -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Brick/mixkit-electronic-retro-block-hit-2185.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/mixkit-electronic-retro-block-hit-2185.wav-08eb56445fac4559b2bb71c6b93bab1d.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://Game/World/StuffSpawner/Stuff/Brick/mixkit-electronic-retro-block-hit-2185.wav" 10 | dest_files=[ "res://.import/mixkit-electronic-retro-block-hit-2185.wav-08eb56445fac4559b2bb71c6b93bab1d.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Bumper/Bumper.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | func bounced(): 4 | $AnimationPlayer.play("activate") 5 | 6 | func destroy(): 7 | queue_free() 8 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Bumper/Bumper.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=16 format=2] 2 | 3 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/Bumper/bumper-activate.png" type="Texture" id=1] 4 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/Bumper/bumper-animation.png" type="Texture" id=2] 5 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/Bumper/Bumper.gd" type="Script" id=3] 6 | 7 | [sub_resource type="CircleShape2D" id=1] 8 | radius = 6.5 9 | 10 | [sub_resource type="AtlasTexture" id=2] 11 | atlas = ExtResource( 2 ) 12 | region = Rect2( 0, 0, 13, 13 ) 13 | 14 | [sub_resource type="AtlasTexture" id=3] 15 | atlas = ExtResource( 2 ) 16 | region = Rect2( 13, 0, 13, 13 ) 17 | 18 | [sub_resource type="AtlasTexture" id=4] 19 | atlas = ExtResource( 2 ) 20 | region = Rect2( 26, 0, 13, 13 ) 21 | 22 | [sub_resource type="AtlasTexture" id=5] 23 | atlas = ExtResource( 2 ) 24 | region = Rect2( 39, 0, 13, 13 ) 25 | 26 | [sub_resource type="AtlasTexture" id=6] 27 | atlas = ExtResource( 2 ) 28 | region = Rect2( 52, 0, 13, 13 ) 29 | 30 | [sub_resource type="AtlasTexture" id=7] 31 | atlas = ExtResource( 2 ) 32 | region = Rect2( 65, 0, 13, 13 ) 33 | 34 | [sub_resource type="AtlasTexture" id=8] 35 | atlas = ExtResource( 2 ) 36 | region = Rect2( 78, 0, 13, 13 ) 37 | 38 | [sub_resource type="AtlasTexture" id=9] 39 | atlas = ExtResource( 2 ) 40 | region = Rect2( 91, 0, 13, 13 ) 41 | 42 | [sub_resource type="AtlasTexture" id=10] 43 | atlas = ExtResource( 2 ) 44 | region = Rect2( 104, 0, 13, 13 ) 45 | 46 | [sub_resource type="SpriteFrames" id=11] 47 | animations = [ { 48 | "frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 2 ) ], 49 | "loop": true, 50 | "name": "default", 51 | "speed": 8.0 52 | } ] 53 | 54 | [sub_resource type="Animation" id=12] 55 | resource_name = "activate" 56 | length = 0.3 57 | tracks/0/type = "value" 58 | tracks/0/path = NodePath("Sprite:visible") 59 | tracks/0/interp = 1 60 | tracks/0/loop_wrap = true 61 | tracks/0/imported = false 62 | tracks/0/enabled = true 63 | tracks/0/keys = { 64 | "times": PoolRealArray( 0, 0.1, 0.2 ), 65 | "transitions": PoolRealArray( 1, 1, 1 ), 66 | "update": 1, 67 | "values": [ true, true, false ] 68 | } 69 | 70 | [node name="Bumper" type="Node2D" groups=[ 71 | "bumper", 72 | ]] 73 | script = ExtResource( 3 ) 74 | 75 | [node name="Area2D" type="Area2D" parent="."] 76 | collision_layer = 2147484672 77 | collision_mask = 1024 78 | 79 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] 80 | position = Vector2( 0.5, 0.5 ) 81 | shape = SubResource( 1 ) 82 | 83 | [node name="AnimatedSprite" type="AnimatedSprite" parent="."] 84 | frames = SubResource( 11 ) 85 | frame = 1 86 | playing = true 87 | 88 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 89 | anims/activate = SubResource( 12 ) 90 | 91 | [node name="Sprite" type="Sprite" parent="."] 92 | visible = false 93 | position = Vector2( 1, 1 ) 94 | texture = ExtResource( 1 ) 95 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Bumper/bumper-activate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/StuffSpawner/Stuff/Bumper/bumper-activate.png -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Bumper/bumper-activate.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/bumper-activate.png-82354d0d2f0a906a886f89f219b7f126.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/StuffSpawner/Stuff/Bumper/bumper-activate.png" 13 | dest_files=[ "res://.import/bumper-activate.png-82354d0d2f0a906a886f89f219b7f126.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Bumper/bumper-animation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/StuffSpawner/Stuff/Bumper/bumper-animation.png -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Bumper/bumper-animation.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/bumper-animation.png-88e5b70259a7fbe9ce2aa564d27c2f0e.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/StuffSpawner/Stuff/Bumper/bumper-animation.png" 13 | dest_files=[ "res://.import/bumper-animation.png-88e5b70259a7fbe9ce2aa564d27c2f0e.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Clouds/Cloud.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | var motion = Vector2(10,0) 4 | 5 | func _ready(): 6 | $Particles2D.process_material = $Particles2D.process_material.duplicate() 7 | $AnimatedSprite.frame = randi()%2 8 | 9 | func _physics_process(delta): 10 | position += motion * delta 11 | if position.x < 0: 12 | motion.x = abs(motion.x) 13 | if position.x > 100: 14 | motion.x = -abs(motion.x) 15 | 16 | func _on_VisibilityEnabler2D_screen_exited(): 17 | queue_free() 18 | 19 | func hit(v): 20 | $AnimationPlayer.play("shake") 21 | $Particles2D.process_material.initial_velocity = abs(v.y*0.3) 22 | $Particles2D.emitting = true 23 | $AudioStreamPlayer2D.play() 24 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Clouds/Cloud.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=10 format=2] 2 | 3 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/Clouds/cloud.png" type="Texture" id=1] 4 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/Clouds/Cloud.gd" type="Script" id=2] 5 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/Clouds/cloud_hit.wav" type="AudioStream" id=3] 6 | 7 | [sub_resource type="ParticlesMaterial" id=1] 8 | emission_shape = 2 9 | emission_box_extents = Vector3( 14, 8, 1 ) 10 | flag_disable_z = true 11 | direction = Vector3( 0, -1, 0 ) 12 | spread = 20.0 13 | gravity = Vector3( 0, 98, 0 ) 14 | initial_velocity = 74.29 15 | initial_velocity_random = 0.85 16 | orbit_velocity = 0.0 17 | orbit_velocity_random = 0.0 18 | color = Color( 0.94902, 0.827451, 0.670588, 1 ) 19 | 20 | [sub_resource type="AtlasTexture" id=2] 21 | atlas = ExtResource( 1 ) 22 | region = Rect2( 0, 0, 33, 19 ) 23 | 24 | [sub_resource type="AtlasTexture" id=3] 25 | atlas = ExtResource( 1 ) 26 | region = Rect2( 33, 0, 33, 19 ) 27 | 28 | [sub_resource type="SpriteFrames" id=4] 29 | animations = [ { 30 | "frames": [ SubResource( 2 ), SubResource( 3 ) ], 31 | "loop": true, 32 | "name": "default", 33 | "speed": 5.0 34 | } ] 35 | 36 | [sub_resource type="RectangleShape2D" id=5] 37 | extents = Vector2( 14, 8 ) 38 | 39 | [sub_resource type="Animation" id=6] 40 | resource_name = "shake" 41 | length = 0.3 42 | tracks/0/type = "value" 43 | tracks/0/path = NodePath("AnimatedSprite:position") 44 | tracks/0/interp = 1 45 | tracks/0/loop_wrap = true 46 | tracks/0/imported = false 47 | tracks/0/enabled = true 48 | tracks/0/keys = { 49 | "times": PoolRealArray( 0, 0.1, 0.2, 0.3 ), 50 | "transitions": PoolRealArray( 1, 1, 1, 1 ), 51 | "update": 0, 52 | "values": [ Vector2( 0, 0 ), Vector2( 0, -5 ), Vector2( 0, 5 ), Vector2( 0, 0 ) ] 53 | } 54 | 55 | [node name="Node2D" type="Node2D" groups=[ 56 | "cloud", 57 | ]] 58 | script = ExtResource( 2 ) 59 | 60 | [node name="Particles2D" type="Particles2D" parent="."] 61 | position = Vector2( 1, 1 ) 62 | emitting = false 63 | amount = 30 64 | one_shot = true 65 | explosiveness = 0.9 66 | process_material = SubResource( 1 ) 67 | 68 | [node name="AnimatedSprite" type="AnimatedSprite" parent="."] 69 | frames = SubResource( 4 ) 70 | speed_scale = 0.0 71 | 72 | [node name="VisibilityEnabler2D" type="VisibilityEnabler2D" parent="."] 73 | rect = Rect2( -10, -10, 20, 200 ) 74 | pause_particles = false 75 | process_parent = true 76 | physics_process_parent = true 77 | 78 | [node name="Area2D" type="Area2D" parent="."] 79 | collision_layer = 1024 80 | collision_mask = 1024 81 | 82 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] 83 | position = Vector2( 1, 1 ) 84 | shape = SubResource( 5 ) 85 | 86 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 87 | anims/shake = SubResource( 6 ) 88 | 89 | [node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] 90 | stream = ExtResource( 3 ) 91 | volume_db = 9.0 92 | bus = "sound" 93 | [connection signal="screen_exited" from="VisibilityEnabler2D" to="." method="_on_VisibilityEnabler2D_screen_exited"] 94 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Clouds/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/StuffSpawner/Stuff/Clouds/cloud.png -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Clouds/cloud.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/cloud.png-210fe0f1a75ffa504608e1e194cf56ab.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/StuffSpawner/Stuff/Clouds/cloud.png" 13 | dest_files=[ "res://.import/cloud.png-210fe0f1a75ffa504608e1e194cf56ab.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Clouds/cloud_hit.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/StuffSpawner/Stuff/Clouds/cloud_hit.wav -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/Clouds/cloud_hit.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/cloud_hit.wav-c3076587bc8187dee178c586291bfea5.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://Game/World/StuffSpawner/Stuff/Clouds/cloud_hit.wav" 10 | dest_files=[ "res://.import/cloud_hit.wav-c3076587bc8187dee178c586291bfea5.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/MilkBowl/MilkBowl.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | func pickup(): 4 | $DespawnTimer.start() 5 | $AudioStreamPlayer2D.play() 6 | visible = false 7 | $Area2D.queue_free() 8 | 9 | func _on_DespawnTimer_timeout(): 10 | queue_free() 11 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/MilkBowl/MilkBowl.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/MilkBowl/milk-bowl.png" type="Texture" id=1] 4 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/MilkBowl/MilkBowl.gd" type="Script" id=2] 5 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/MilkBowl/mixkit-unlock-game-notification-253.wav" type="AudioStream" id=3] 6 | 7 | [sub_resource type="RectangleShape2D" id=1] 8 | extents = Vector2( 4, 4 ) 9 | 10 | [sub_resource type="AudioStreamRandomPitch" id=2] 11 | audio_stream = ExtResource( 3 ) 12 | random_pitch = 1.03 13 | 14 | [node name="MilkBowl" type="Node2D" groups=[ 15 | "milkbowl", 16 | ]] 17 | script = ExtResource( 2 ) 18 | 19 | [node name="Sprite" type="Sprite" parent="."] 20 | texture = ExtResource( 1 ) 21 | 22 | [node name="Area2D" type="Area2D" parent="."] 23 | collision_layer = 2147485696 24 | collision_mask = 2048 25 | 26 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] 27 | shape = SubResource( 1 ) 28 | 29 | [node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] 30 | stream = SubResource( 2 ) 31 | bus = "sound" 32 | 33 | [node name="DespawnTimer" type="Timer" parent="."] 34 | [connection signal="timeout" from="DespawnTimer" to="." method="_on_DespawnTimer_timeout"] 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/MilkBowl/milk-bowl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/StuffSpawner/Stuff/MilkBowl/milk-bowl.png -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/MilkBowl/milk-bowl.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/milk-bowl.png-8bdf1e231e7e46f1b92fcb77e1162c98.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/StuffSpawner/Stuff/MilkBowl/milk-bowl.png" 13 | dest_files=[ "res://.import/milk-bowl.png-8bdf1e231e7e46f1b92fcb77e1162c98.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/MilkBowl/mixkit-unlock-game-notification-253.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/StuffSpawner/Stuff/MilkBowl/mixkit-unlock-game-notification-253.wav -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/MilkBowl/mixkit-unlock-game-notification-253.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/mixkit-unlock-game-notification-253.wav-af56617821b468588dd0f4c13d1c62fa.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://Game/World/StuffSpawner/Stuff/MilkBowl/mixkit-unlock-game-notification-253.wav" 10 | dest_files=[ "res://.import/mixkit-unlock-game-notification-253.wav-af56617821b468588dd0f4c13d1c62fa.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/MoneyFish/MoneyFish.gd: -------------------------------------------------------------------------------- 1 | extends "res://Game/World/StuffSpawner/Stuff/BaseStuff.gd" 2 | 3 | enum STATES {IDLE, MAGNETIZED, PICKED_UP} 4 | var state = STATES.IDLE 5 | var magnetized_to = null 6 | 7 | func set_sound(s): 8 | $AudioStreamPlayer2D.stream.audio_stream = s 9 | 10 | func _on_pickup(): 11 | state = STATES.PICKED_UP 12 | 13 | func set_texture(tex): 14 | $Sprite.texture = tex 15 | 16 | func _physics_process(delta): 17 | if state == STATES.MAGNETIZED && magnetized_to != null: 18 | position += (magnetized_to.position - position).normalized()*100.0*delta 19 | 20 | func magnetized(to): 21 | if state != STATES.PICKED_UP: 22 | magnetized_to = to 23 | state = STATES.MAGNETIZED 24 | 25 | func demagnetized(): 26 | state = STATES.IDLE 27 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/MoneyFish/MoneyFish.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=2] 2 | 3 | [ext_resource path="res://Game/GUI/fish3.png" type="Texture" id=1] 4 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/MoneyFish/MoneyFish.gd" type="Script" id=2] 5 | [ext_resource path="res://slkscre.ttf" type="DynamicFontData" id=3] 6 | [ext_resource path="res://Game/World/StuffSpawner/Stuff/MoneyFish/fish2.wav" type="AudioStream" id=4] 7 | 8 | [sub_resource type="RectangleShape2D" id=1] 9 | extents = Vector2( 4, 3 ) 10 | 11 | [sub_resource type="DynamicFont" id=2] 12 | size = 8 13 | outline_size = 1 14 | outline_color = Color( 0.152941, 0.152941, 0.266667, 1 ) 15 | use_mipmaps = true 16 | font_data = ExtResource( 3 ) 17 | 18 | [sub_resource type="AudioStreamRandomPitch" id=3] 19 | audio_stream = ExtResource( 4 ) 20 | random_pitch = 1.05 21 | 22 | [node name="MoneyFish" type="Node2D" groups=[ 23 | "fish", 24 | ]] 25 | script = ExtResource( 2 ) 26 | 27 | [node name="Sprite" type="Sprite" parent="."] 28 | texture = ExtResource( 1 ) 29 | 30 | [node name="Area2D" type="Area2D" parent="."] 31 | collision_layer = 2147485696 32 | collision_mask = 2048 33 | 34 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] 35 | shape = SubResource( 1 ) 36 | 37 | [node name="DespawnTimer" type="Timer" parent="."] 38 | wait_time = 0.7 39 | one_shot = true 40 | 41 | [node name="Label" type="Label" parent="."] 42 | visible = false 43 | margin_left = -7.0 44 | margin_top = -11.0 45 | margin_right = 8.0 46 | margin_bottom = -2.0 47 | custom_fonts/font = SubResource( 2 ) 48 | custom_colors/font_color = Color( 0.984314, 0.960784, 0.937255, 1 ) 49 | text = "+1" 50 | __meta__ = { 51 | "_edit_use_anchors_": false 52 | } 53 | 54 | [node name="Tween" type="Tween" parent="."] 55 | 56 | [node name="VisibilityEnabler2D" type="VisibilityEnabler2D" parent="."] 57 | rect = Rect2( -10, -10, 20, 200 ) 58 | process_parent = true 59 | physics_process_parent = true 60 | 61 | [node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] 62 | stream = SubResource( 3 ) 63 | volume_db = -5.0 64 | attenuation = 0.0384732 65 | bus = "sound" 66 | [connection signal="timeout" from="DespawnTimer" to="." method="_on_DespawnTimer_timeout"] 67 | [connection signal="screen_exited" from="VisibilityEnabler2D" to="." method="_on_VisibilityEnabler2D_screen_exited"] 68 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/MoneyFish/fish1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/StuffSpawner/Stuff/MoneyFish/fish1.wav -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/MoneyFish/fish1.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/fish1.wav-7be85285ce3f38d6f2d23f18af984624.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://Game/World/StuffSpawner/Stuff/MoneyFish/fish1.wav" 10 | dest_files=[ "res://.import/fish1.wav-7be85285ce3f38d6f2d23f18af984624.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/MoneyFish/fish2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/StuffSpawner/Stuff/MoneyFish/fish2.wav -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/MoneyFish/fish2.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/fish2.wav-02746f954298b41a3d7275265319cb69.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://Game/World/StuffSpawner/Stuff/MoneyFish/fish2.wav" 10 | dest_files=[ "res://.import/fish2.wav-02746f954298b41a3d7275265319cb69.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/MoneyFish/fish3.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/StuffSpawner/Stuff/MoneyFish/fish3.wav -------------------------------------------------------------------------------- /Catapult/Game/World/StuffSpawner/Stuff/MoneyFish/fish3.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/fish3.wav-2b33e7c3a2e4de5f6fb402fb63c088dd.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://Game/World/StuffSpawner/Stuff/MoneyFish/fish3.wav" 10 | dest_files=[ "res://.import/fish3.wav-2b33e7c3a2e4de5f6fb402fb63c088dd.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /Catapult/Game/World/Trampoline/Trampoline.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | onready var line = $Line2D 4 | onready var outline = $Line2D2 5 | onready var shape = $Area2D/CollisionShape2D 6 | onready var upgrades = get_tree().root.get_node("/root/UnlockedUpgrades") 7 | onready var particles = $Particles2D 8 | 9 | func set_length(vec): 10 | line.points[1] = vec 11 | outline.points[1] = vec 12 | shape.shape.b = vec 13 | 14 | func _on_VisibilityNotifier2D_screen_exited(): 15 | queue_free() 16 | 17 | func get_normal(): 18 | var n1 = Vector2(-line.points[1].y, line.points[1].x) 19 | var n2 = Vector2(line.points[1].y, -line.points[1].x) 20 | 21 | # there are 2 normals, we are only interested in the one pointing up 22 | if n1.y <0: 23 | return n1.normalized() 24 | return n2.normalized() 25 | 26 | func get_strength(): 27 | return clamp(line.points[1].length() / 20.0, 0.1, 1.0) * upgrades.get_upgrade_value("trampoline_strength") 28 | 29 | func _on_bounce(): 30 | $AudioStreamPlayer2D.play() 31 | $DespawnTimer.start() 32 | line.visible = false 33 | shape.disabled = true 34 | particles.amount = ceil(line.points[1].length()*.4)+1 35 | particles.process_material.emission_box_extents.x = line.points[1].length()*.5 36 | particles.rotation = get_normal().angle()+PI*.5 37 | particles.position = .5 * line.points[1] 38 | particles.emitting = true 39 | 40 | func bounced(): 41 | call_deferred("_on_bounce") 42 | 43 | 44 | func _on_DespawnTimer_timeout(): 45 | queue_free() 46 | -------------------------------------------------------------------------------- /Catapult/Game/World/Trampoline/Trampoline.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://Game/World/Trampoline/Trampoline.gd" type="Script" id=1] 4 | [ext_resource path="res://Game/World/Trampoline/wobble2.wav" type="AudioStream" id=2] 5 | 6 | [sub_resource type="SegmentShape2D" id=1] 7 | b = Vector2( 0, 0 ) 8 | 9 | [sub_resource type="ParticlesMaterial" id=2] 10 | emission_shape = 2 11 | emission_box_extents = Vector3( 20, 2, 1 ) 12 | flag_disable_z = true 13 | direction = Vector3( 0, -1, 0 ) 14 | gravity = Vector3( 0, 98, 0 ) 15 | initial_velocity = 30.0 16 | initial_velocity_random = 0.7 17 | orbit_velocity = 0.0 18 | orbit_velocity_random = 0.0 19 | 20 | [sub_resource type="AudioStreamRandomPitch" id=3] 21 | audio_stream = ExtResource( 2 ) 22 | random_pitch = 1.05 23 | 24 | [node name="Trampoline" type="Node2D" groups=[ 25 | "trampoline", 26 | ]] 27 | script = ExtResource( 1 ) 28 | 29 | [node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="."] 30 | rect = Rect2( -100, -100, 200, 200 ) 31 | 32 | [node name="Area2D" type="Area2D" parent="."] 33 | collision_layer = 1024 34 | collision_mask = 1024 35 | 36 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] 37 | shape = SubResource( 1 ) 38 | 39 | [node name="Line2D2" type="Line2D" parent="."] 40 | points = PoolVector2Array( 0, 0, 0, 0 ) 41 | width = 4.0 42 | default_color = Color( 0.152941, 0.152941, 0.266667, 1 ) 43 | 44 | [node name="Line2D" type="Line2D" parent="."] 45 | points = PoolVector2Array( 0, 0, 0, 0 ) 46 | width = 2.0 47 | default_color = Color( 0.984314, 0.960784, 0.937255, 1 ) 48 | 49 | [node name="Particles2D" type="Particles2D" parent="."] 50 | emitting = false 51 | amount = 10 52 | one_shot = true 53 | explosiveness = 0.8 54 | randomness = 1.0 55 | process_material = SubResource( 2 ) 56 | 57 | [node name="DespawnTimer" type="Timer" parent="."] 58 | one_shot = true 59 | 60 | [node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] 61 | stream = SubResource( 3 ) 62 | volume_db = 10.0 63 | attenuation = 0.267943 64 | bus = "sound" 65 | [connection signal="screen_exited" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_screen_exited"] 66 | [connection signal="timeout" from="DespawnTimer" to="." method="_on_DespawnTimer_timeout"] 67 | -------------------------------------------------------------------------------- /Catapult/Game/World/Trampoline/wobble1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/Trampoline/wobble1.wav -------------------------------------------------------------------------------- /Catapult/Game/World/Trampoline/wobble1.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/wobble1.wav-709249420ab9ccafbcb69a27a05792ef.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://Game/World/Trampoline/wobble1.wav" 10 | dest_files=[ "res://.import/wobble1.wav-709249420ab9ccafbcb69a27a05792ef.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /Catapult/Game/World/Trampoline/wobble2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/Trampoline/wobble2.wav -------------------------------------------------------------------------------- /Catapult/Game/World/Trampoline/wobble2.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/wobble2.wav-a115d93e38dfd72d6bd0d376c2d5608f.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://Game/World/Trampoline/wobble2.wav" 10 | dest_files=[ "res://.import/wobble2.wav-a115d93e38dfd72d6bd0d376c2d5608f.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /Catapult/Game/World/World.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | signal update_milk 4 | signal hide_milk_bar 5 | signal show_milk_bar 6 | signal show_launch_tutorial 7 | signal show_trampoline_tutorial 8 | signal show_shop_tutorial 9 | signal launched 10 | signal madetrampoline 11 | signal reached_moon 12 | 13 | var first_launch = true 14 | onready var upgrades = get_tree().root.get_node("/root/UnlockedUpgrades") 15 | onready var mousestate = get_tree().root.get_node("/root/MouseControl") 16 | onready var camera = $Camera2D 17 | onready var tween = $Tween 18 | onready var moon_sprite = $CanvasLayer/moon 19 | onready var line_drawer = $BounceLineDrawer 20 | onready var stuff_spawner = $LaunchStuffSpawner 21 | 22 | const moon_height = 15000.0 23 | var height_achieved = 0.0 24 | 25 | func _ready(): 26 | $OpeningAnimation.play("intro") 27 | $Catapult.connect("launch_cat", self, "_on_catapult_launch_cat") 28 | camera.connect("track_object_fallen", self, "_on_camera_track_object_fallen") 29 | _connect_cat_signals() 30 | 31 | func _on_catapult_launch_cat(launch_vec): 32 | emit_signal("launched") 33 | var cat = mousestate.get_held_cat() 34 | cat.launch(-launch_vec*10.0*upgrades.get_upgrade_value("catapult_strength")) 35 | emit_signal("update_milk", cat.get_milk()) 36 | emit_signal("show_milk_bar") 37 | line_drawer.update_cat_milk(cat.get_milk()) 38 | camera.track(cat) 39 | line_drawer.go_active() 40 | stuff_spawner.go_active() 41 | tween.remove(camera, "reset") 42 | #$LaunchMusic.play() 43 | #$CalmMusic.stop() 44 | if first_launch: 45 | $LaunchMusic.play() 46 | first_launch = false 47 | 48 | $CalmMusic.volume_db = -80 49 | $LaunchMusic.volume_db = 0 50 | 51 | func _on_camera_track_object_fallen(): 52 | for b in get_tree().get_nodes_in_group("booster"): 53 | b.queue_free() 54 | 55 | _move_cam_down() 56 | var cat = mousestate.get_held_cat() 57 | height_achieved = cat.position.y 58 | cat.position.y = max(cat.position.y, -50) 59 | $CatFall.play() 60 | 61 | func _move_cam_down(): 62 | camera.go_idle() 63 | tween.interpolate_property(camera, "position:y", camera.position.y, 75.0, 1.5, Tween.TRANS_EXPO, Tween.EASE_IN_OUT) 64 | tween.interpolate_callback(camera, 1.5, "reset") 65 | tween.interpolate_method(self, "change_moon_size", camera.position.y, 75.0, 1.5, Tween.TRANS_EXPO, Tween.EASE_IN_OUT) 66 | tween.start() 67 | 68 | func disable_trampolines(): 69 | line_drawer.disable() 70 | for c in $Trampolines.get_children(): 71 | c.queue_free() 72 | 73 | func change_moon_size(height): 74 | var interpol_val = clamp(-height/moon_height,0.0,1.0) 75 | moon_sprite.frame = round(lerp(0, 8, interpol_val)) 76 | moon_sprite.position.x = lerp(65, 50, interpol_val) 77 | moon_sprite.position.y = lerp(29, 75, interpol_val) 78 | 79 | func _on_Camera2D_change_height(height): 80 | change_moon_size(height) 81 | 82 | if -height > moon_height: 83 | _reached_moon() 84 | 85 | func _reached_moon(): 86 | emit_signal("reached_moon") 87 | camera.go_idle() 88 | 89 | func _on_BounceLineDrawer_remove_milk(amount): 90 | var cat = mousestate.get_held_cat() 91 | cat.remove_milk(amount) 92 | line_drawer.update_cat_milk(cat.get_milk()) 93 | 94 | func _on_BounceLineDrawer_visual_change_milk(amount): 95 | var cat = mousestate.get_held_cat() 96 | var current_milk = cat.milk - amount 97 | 98 | emit_signal("update_milk", current_milk) 99 | 100 | func _connect_cat_signals(): 101 | for c in $Cats.get_children(): 102 | if !c.is_connected("landed", self, "_on_cat_land"): 103 | c.connect("landed", self, "_on_cat_land") 104 | if !c.is_connected("change_milk", self, "_on_cat_change_milk"): 105 | c.connect("change_milk", self, "_on_cat_change_milk") 106 | 107 | func _on_cat_change_milk(milk): 108 | line_drawer.update_cat_milk(milk) 109 | emit_signal("update_milk", milk) 110 | 111 | func _on_cat_land(): 112 | _move_cam_down() 113 | disable_trampolines() 114 | emit_signal("hide_milk_bar") 115 | emit_signal("show_shop_tutorial") 116 | stuff_spawner.go_idle() 117 | 118 | #$LaunchMusic.stop() 119 | #$CalmMusic.play() 120 | $CalmMusic.volume_db = 0 121 | $LaunchMusic.volume_db = -80 122 | 123 | if !just_reset: 124 | $HideHeight.start() 125 | $Control/VBoxContainer/HowFar.text = String(-int(height_achieved))+"m" 126 | $Control/VBoxContainer/ToGo.text = String(int(moon_height+height_achieved))+"m" 127 | $Control.visible = true 128 | else: 129 | just_reset = false 130 | 131 | 132 | func _on_HideHeight_timeout(): 133 | $Control.visible = false 134 | 135 | 136 | func _on_AnimationOver_timeout(): 137 | $Cats/Cat.start() 138 | emit_signal("show_launch_tutorial") 139 | 140 | 141 | func _on_BounceLineDrawer_made_trampoline(): 142 | emit_signal("madetrampoline") 143 | 144 | 145 | func _on_Camera2D_cat_falling(): 146 | emit_signal("show_trampoline_tutorial") 147 | 148 | var just_reset = false 149 | func reset(): 150 | $CalmMusic.volume_db = 0 151 | $LaunchMusic.volume_db = -80 152 | just_reset = true 153 | _on_camera_track_object_fallen() 154 | var cat = mousestate.get_held_cat() 155 | cat.position.y = 140 156 | $Catapult.check_upgrades() 157 | first_launch = true 158 | -------------------------------------------------------------------------------- /Catapult/Game/World/mixkit-arcade-retro-game-over-213.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/mixkit-arcade-retro-game-over-213.wav -------------------------------------------------------------------------------- /Catapult/Game/World/mixkit-arcade-retro-game-over-213.wav.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="wav" 4 | type="AudioStreamSample" 5 | path="res://.import/mixkit-arcade-retro-game-over-213.wav-e70b52b6e241c74b6b1d97843fbcbda1.sample" 6 | 7 | [deps] 8 | 9 | source_file="res://Game/World/mixkit-arcade-retro-game-over-213.wav" 10 | dest_files=[ "res://.import/mixkit-arcade-retro-game-over-213.wav-e70b52b6e241c74b6b1d97843fbcbda1.sample" ] 11 | 12 | [params] 13 | 14 | force/8_bit=false 15 | force/mono=false 16 | force/max_rate=false 17 | force/max_rate_hz=44100 18 | edit/trim=false 19 | edit/normalize=false 20 | edit/loop=false 21 | compress/mode=0 22 | -------------------------------------------------------------------------------- /Catapult/Game/World/rat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/World/rat.png -------------------------------------------------------------------------------- /Catapult/Game/World/rat.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/rat.png-f16955f092bb96e05359433ed456fdb2.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Game/World/rat.png" 13 | dest_files=[ "res://.import/rat.png-f16955f092bb96e05359433ed456fdb2.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/Game/calm.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/calm.ogg -------------------------------------------------------------------------------- /Catapult/Game/calm.ogg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="ogg_vorbis" 4 | type="AudioStreamOGGVorbis" 5 | path="res://.import/calm.ogg-9cc65b11546b28f8c63962a799c6c877.oggstr" 6 | 7 | [deps] 8 | 9 | source_file="res://Game/calm.ogg" 10 | dest_files=[ "res://.import/calm.ogg-9cc65b11546b28f8c63962a799c6c877.oggstr" ] 11 | 12 | [params] 13 | 14 | loop=true 15 | loop_offset=0 16 | -------------------------------------------------------------------------------- /Catapult/Game/launch.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/Game/launch.ogg -------------------------------------------------------------------------------- /Catapult/Game/launch.ogg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="ogg_vorbis" 4 | type="AudioStreamOGGVorbis" 5 | path="res://.import/launch.ogg-5864d2dfaf0014c3223bd3e54280b63a.oggstr" 6 | 7 | [deps] 8 | 9 | source_file="res://Game/launch.ogg" 10 | dest_files=[ "res://.import/launch.ogg-5864d2dfaf0014c3223bd3e54280b63a.oggstr" ] 11 | 12 | [params] 13 | 14 | loop=true 15 | loop_offset=0 16 | -------------------------------------------------------------------------------- /Catapult/MouseControl/MouseControl.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | enum STATES {MENU, IDLE, CAT_GRAB, CATAPULT, FLYING} 4 | var state = STATES.IDLE 5 | var held_cat = null 6 | 7 | func set_state_menu(): 8 | state = STATES.MENU 9 | 10 | func set_state_idle(): 11 | state = STATES.IDLE 12 | 13 | func set_state_catapult(): 14 | state = STATES.CATAPULT 15 | 16 | func set_state_flying(): 17 | state = STATES.FLYING 18 | 19 | func set_state_cat_grab(): 20 | state = STATES.CAT_GRAB 21 | 22 | func set_held_cat(c): 23 | held_cat = c 24 | 25 | func get_held_cat(): 26 | return held_cat 27 | 28 | func is_idle(): 29 | return state == STATES.IDLE 30 | 31 | func is_catapult(): 32 | return state == STATES.CATAPULT 33 | 34 | func is_cat_grab(): 35 | return state == STATES.CAT_GRAB 36 | -------------------------------------------------------------------------------- /Catapult/MouseControl/MouseControl.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://MouseControl/MouseControl.gd" type="Script" id=1] 4 | 5 | [node name="MouseControl" type="Node"] 6 | script = ExtResource( 1 ) 7 | -------------------------------------------------------------------------------- /Catapult/default_bus_layout.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="AudioBusLayout" format=2] 2 | 3 | [resource] 4 | bus/1/name = "music" 5 | bus/1/solo = false 6 | bus/1/mute = false 7 | bus/1/bypass_fx = false 8 | bus/1/volume_db = 0.0 9 | bus/1/send = "Master" 10 | bus/2/name = "sound" 11 | bus/2/solo = false 12 | bus/2/mute = false 13 | bus/2/bypass_fx = false 14 | bus/2/volume_db = 0.0 15 | bus/2/send = "Master" 16 | -------------------------------------------------------------------------------- /Catapult/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | [resource] 6 | background_mode = 2 7 | background_sky = SubResource( 1 ) 8 | -------------------------------------------------------------------------------- /Catapult/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/icon.png -------------------------------------------------------------------------------- /Catapult/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Catapult/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="Catapult" 19 | run/main_scene="res://Game/Game.tscn" 20 | config/icon="res://icon.png" 21 | 22 | [audio] 23 | 24 | output_latency.web=15 25 | 26 | [autoload] 27 | 28 | MouseControl="*res://MouseControl/MouseControl.tscn" 29 | UnlockedUpgrades="*res://Game/Upgrades/UnlockedUpgrades.tscn" 30 | 31 | [display] 32 | 33 | window/size/width=100 34 | window/size/height=150 35 | window/size/test_width=700 36 | window/size/test_height=1050 37 | window/stretch/mode="viewport" 38 | window/stretch/aspect="keep" 39 | 40 | [importer_defaults] 41 | 42 | texture={ 43 | "compress/bptc_ldr": 0, 44 | "compress/hdr_mode": 0, 45 | "compress/lossy_quality": 0.7, 46 | "compress/mode": 0, 47 | "compress/normal_map": 0, 48 | "detect_3d": false, 49 | "flags/anisotropic": false, 50 | "flags/filter": false, 51 | "flags/mipmaps": false, 52 | "flags/repeat": 0, 53 | "flags/srgb": 2, 54 | "process/HDR_as_SRGB": false, 55 | "process/fix_alpha_border": true, 56 | "process/invert_color": false, 57 | "process/premult_alpha": false, 58 | "size_limit": 0, 59 | "stream": false, 60 | "svg/scale": 1.0 61 | } 62 | 63 | [input] 64 | 65 | mouse_left={ 66 | "deadzone": 0.5, 67 | "events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null) 68 | ] 69 | } 70 | 71 | [rendering] 72 | 73 | quality/2d/use_pixel_snap=true 74 | environment/default_environment="res://default_env.tres" 75 | quality/dynamic_fonts/use_oversampling=false 76 | -------------------------------------------------------------------------------- /Catapult/slkscre.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Deep-Fold/CatapultGame/a08c69a5c77f408ea08cdece40227dfa2e813ecb/Catapult/slkscre.ttf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Catapult Game 2 | 3 | Little game for github gameoff 2020. 4 | 5 | Code started out alright, but ended up as a nice italian dish. Oh well. 6 | 7 | --------------------------------------------------------------------------------