Skip to content

Commit

Permalink
FINISH STUFF FUCK FUCK FUCK
Browse files Browse the repository at this point in the history
  • Loading branch information
Emma-Fuller committed Aug 21, 2023
1 parent 7a0ee70 commit 8b5c4ba
Show file tree
Hide file tree
Showing 17 changed files with 197 additions and 14 deletions.
4 changes: 4 additions & 0 deletions Globals/PowerupManager.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends Node

var pewpewactive = false
var tealberryactive = false
2 changes: 1 addition & 1 deletion Scenes/FallingItem/FallingItem.gd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func _physics_process(delta):

rotation += delta * rotation_speed * rotate_scale

if drop_controller.magnet_active and item_data.score_value > 0:
if PowerupManager.tealberryactive and item_data.score_value > 0:
var basket: Node2D = get_tree().get_first_node_in_group("basket")
if basket and global_position.distance_to(basket.global_position) < 200:
global_position = global_position.move_toward(
Expand Down
8 changes: 4 additions & 4 deletions Scenes/Game/GameManager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ var pool: ItemPool
var defaultPool := preload("res://Resources/Pools/DefaultItemPool.tres")
var pewPewPowerPool := preload("res://Resources/Pools/PewPewPowerPool.tres")

var magnet_active := false

var pewpewtimer = Timer.new()
var tealberrytimer = Timer.new()

Expand Down Expand Up @@ -51,6 +49,7 @@ func on_game_ended():
func item_got(item_name: String):
match item_name:
"PewPew":
PowerupManager.pewpewactive = true
PewPewArea.visible = true
$"Spawn Timer".wait_time = 0.50
pool = pewPewPowerPool
Expand All @@ -62,17 +61,18 @@ func item_got(item_name: String):
pewpewtimer.start(5)
"Tealberry":
TealberryArea.visible = true
magnet_active = true
PowerupManager.tealberryactive = true
tealberrytimer.start(5)

func end_pewpew_time():
PowerupManager.pewpewactive = false
PewPewArea.visible = false
$"Spawn Timer".wait_time = 0.75
pool = defaultPool

func end_tealberry_time():
TealberryArea.visible = false
magnet_active = false
PowerupManager.tealberryactive = false

func _process(delta):
if PewPewArea and TealberryArea:
Expand Down
21 changes: 16 additions & 5 deletions Scenes/Player/Player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,29 @@ var stunned = false

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if PowerupManager.pewpewactive and $"Ellie Sprite".animation == "walking":
$"Ellie Sprite".play("walkingpew")
if PowerupManager.pewpewactive and $"Ellie Sprite".animation == "neutral":
$"Ellie Sprite".play("neutralpew")
if (not PowerupManager.pewpewactive) and $"Ellie Sprite".animation == "neutralpew":
$"Ellie Sprite".play("neutral")
if (not PowerupManager.pewpewactive) and $"Ellie Sprite".animation == "walkingpew":
$"Ellie Sprite".play("walking")

if stunned: return

var movingVector = Vector2(Input.get_axis("Move Left", "Move Right"), 0)

if not moving and movingVector.length() != 0:
$"Ellie Sprite".play("walking")
$"Ellie Sprite".play(
"walkingpew" if PowerupManager.pewpewactive else "walking"
)
moving = true

if moving and movingVector.length() == 0:
$"Ellie Sprite".play("neutral")
$"Ellie Sprite".play(
"neutralpew" if PowerupManager.pewpewactive else "neutral"
)
moving = false

if movingVector.x < 0:
Expand All @@ -30,10 +43,8 @@ func _process(delta):
func stun_for(duration: int):
if not stunned:
moving = false
$"Ellie Sprite".scale.y = -1
$"Ellie Sprite".play("walking")
$"Ellie Sprite".play("bonk")
stunned = true
await get_tree().create_timer(duration).timeout
$"Ellie Sprite".scale.y = 1
$"Ellie Sprite".play("neutral")
stunned = false
39 changes: 35 additions & 4 deletions Scenes/Player/Player.tscn
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
[gd_scene load_steps=7 format=3 uid="uid://dsyutym4unj7t"]
[gd_scene load_steps=11 format=3 uid="uid://dsyutym4unj7t"]

[ext_resource type="Script" path="res://Scenes/Player/Player.gd" id="1_xu5fr"]
[ext_resource type="Texture2D" uid="uid://bi80s0ld6whu0" path="res://Sprites/EllieNeutral.png" id="2_7wcg7"]
[ext_resource type="Texture2D" uid="uid://bbikxkalmd216" path="res://Sprites/EATING_SHIT.png" id="2_lyb5a"]
[ext_resource type="Texture2D" uid="uid://3ok6dbf31lwd" path="res://Sprites/EllieRun1.png" id="3_a5pmr"]
[ext_resource type="Texture2D" uid="uid://bb2gdies6dd4q" path="res://Sprites/EllieRun2.png" id="4_v18po"]
[ext_resource type="Texture2D" uid="uid://cfx82qkmliqbb" path="res://Sprites/ElliewithpewNeutral.png" id="4_w57fv"]
[ext_resource type="Texture2D" uid="uid://c5c7e2ox06u7n" path="res://Sprites/ElliewithpewRun1.png" id="7_bf1wl"]
[ext_resource type="Texture2D" uid="uid://bjoe0t2t4yih2" path="res://Sprites/ElliewithpewRun2.png" id="8_uer4y"]

[sub_resource type="SpriteFrames" id="SpriteFrames_1gvd5"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_lyb5a")
}],
"loop": true,
"name": &"bonk",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_7wcg7")
}],
"loop": true,
Expand All @@ -17,6 +29,14 @@ animations = [{
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("4_w57fv")
}],
"loop": true,
"name": &"neutralpew",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("3_a5pmr")
}, {
"duration": 1.0,
Expand All @@ -25,6 +45,17 @@ animations = [{
"loop": true,
"name": &"walking",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("7_bf1wl")
}, {
"duration": 1.0,
"texture": ExtResource("8_uer4y")
}],
"loop": true,
"name": &"walkingpew",
"speed": 5.0
}]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_pf1bv"]
Expand All @@ -36,14 +67,14 @@ speed = 350

[node name="Ellie Sprite" type="AnimatedSprite2D" parent="."]
texture_filter = 1
position = Vector2(224, 0)
position = Vector2(236, -65)
sprite_frames = SubResource("SpriteFrames_1gvd5")
animation = &"walking"
animation = &"walkingpew"

[node name="Collider" type="Area2D" parent="."]
position = Vector2(224, 0)
collision_layer = 2

[node name="Collision Shape" type="CollisionShape2D" parent="Collider" groups=["basket"]]
position = Vector2(-248, -267)
position = Vector2(-239, -250)
shape = SubResource("RectangleShape2D_pf1bv")
Binary file added Sprites/EATING_SHIT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Sprites/EATING_SHIT.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bbikxkalmd216"
path="res://.godot/imported/EATING_SHIT.png-9f711ad8e510fb7f3fbbe213589e679a.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Sprites/EATING_SHIT.png"
dest_files=["res://.godot/imported/EATING_SHIT.png-9f711ad8e510fb7f3fbbe213589e679a.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file modified Sprites/EllieNeutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Sprites/EllieRun1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Sprites/EllieRun2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Sprites/ElliewithpewNeutral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Sprites/ElliewithpewNeutral.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cfx82qkmliqbb"
path="res://.godot/imported/ElliewithpewNeutral.png-5297468066ab3f34191ad1dc771a8732.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Sprites/ElliewithpewNeutral.png"
dest_files=["res://.godot/imported/ElliewithpewNeutral.png-5297468066ab3f34191ad1dc771a8732.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added Sprites/ElliewithpewRun1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Sprites/ElliewithpewRun1.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://c5c7e2ox06u7n"
path="res://.godot/imported/ElliewithpewRun1.png-e1688b2c0815beded1642f2825c0ad39.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Sprites/ElliewithpewRun1.png"
dest_files=["res://.godot/imported/ElliewithpewRun1.png-e1688b2c0815beded1642f2825c0ad39.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added Sprites/ElliewithpewRun2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Sprites/ElliewithpewRun2.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bjoe0t2t4yih2"
path="res://.godot/imported/ElliewithpewRun2.png-fa26de17b491e39a17c1dea0f39a0647.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Sprites/ElliewithpewRun2.png"
dest_files=["res://.godot/imported/ElliewithpewRun2.png-fa26de17b491e39a17c1dea0f39a0647.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
1 change: 1 addition & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ config/icon="res://icon.svg"
ScoreManager="*res://Globals/ScoreManager.gd"
MusicManager="*res://Globals/MusicManager.gd"
OhfuckManager="*res://Globals/OHFUCKManager.gd"
PowerupManager="*res://Globals/PowerupManager.gd"

[display]

Expand Down

0 comments on commit 8b5c4ba

Please sign in to comment.