It's Cow Game! Version 2.04!
This commit is contained in:
commit
a9e1ed9ddd
3148 changed files with 95332 additions and 0 deletions
14
MiniGames/FlappyCow/World/Cloud.gd
Normal file
14
MiniGames/FlappyCow/World/Cloud.gd
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
extends Sprite2D
|
||||
|
||||
@export var speed = 100
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
var velocity = Vector2(speed,0)
|
||||
var motion = velocity * delta
|
||||
position += motion
|
||||
17
MiniGames/FlappyCow/World/Sun.gd
Normal file
17
MiniGames/FlappyCow/World/Sun.gd
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
extends Sprite2D
|
||||
|
||||
@export var speed = -10
|
||||
var y_pos
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
y_pos = position.y
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
var cameraPos = get_parent().get_screen_center_position()
|
||||
var velocity = Vector2(speed,0)
|
||||
global_position.y = 150
|
||||
var motion = velocity * delta
|
||||
|
||||
position += motion
|
||||
37
MiniGames/FlappyCow/World/TileMap.tscn
Normal file
37
MiniGames/FlappyCow/World/TileMap.tscn
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://dxeva15lnv7wm"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dxtx8htjdu1mh" path="res://Art/TilesetOf5.png" id="1"]
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_aiwi6"]
|
||||
texture = ExtResource("1")
|
||||
texture_region_size = Vector2i(256, 256)
|
||||
1:1/0 = 0
|
||||
1:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
1:1/0/physics_layer_0/angular_velocity = 0.0
|
||||
1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-128, -128, 128, -128, 128, 128, -128, 128)
|
||||
0:0/0 = 0
|
||||
0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
0:0/0/physics_layer_0/angular_velocity = 0.0
|
||||
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(128, -128, 128, 128, -128, 128)
|
||||
2:0/0 = 0
|
||||
2:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
2:0/0/physics_layer_0/angular_velocity = 0.0
|
||||
2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-128, -128, -128, 128, 128, 128)
|
||||
2:2/0 = 0
|
||||
2:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
2:2/0/physics_layer_0/angular_velocity = 0.0
|
||||
2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-128, -128, 128, -128, -128, 128)
|
||||
0:2/0 = 0
|
||||
0:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
|
||||
0:2/0/physics_layer_0/angular_velocity = 0.0
|
||||
0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-128, -128, 128, -128, 128, 128)
|
||||
|
||||
[sub_resource type="TileSet" id="10"]
|
||||
tile_size = Vector2i(256, 256)
|
||||
occlusion_layer_0/light_mask = 1
|
||||
physics_layer_0/collision_layer = 2
|
||||
sources/0 = SubResource("TileSetAtlasSource_aiwi6")
|
||||
|
||||
[node name="TileMap" type="TileMap"]
|
||||
tile_set = SubResource("10")
|
||||
format = 2
|
||||
39
MiniGames/FlappyCow/World/WallNode.gd
Normal file
39
MiniGames/FlappyCow/World/WallNode.gd
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
extends Node2D
|
||||
|
||||
@export var wall_count : float = 17
|
||||
@export var max_vert_diff : float = 300
|
||||
@export var wall_dist : float = 800
|
||||
|
||||
var vert_total : float = 300
|
||||
var vert_max : float = 710
|
||||
var rng = RandomNumberGenerator.new()
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
if wall_count > 0:
|
||||
var copy = self.duplicate()
|
||||
copy.position.x = wall_dist
|
||||
|
||||
var dist = rng.randf_range(-max_vert_diff, max_vert_diff)
|
||||
|
||||
if vert_total <= 40: dist += 50
|
||||
if vert_total >= 670: dist -= 50
|
||||
|
||||
if dist + vert_total < 0:
|
||||
dist = -vert_total
|
||||
elif dist + vert_total > vert_max:
|
||||
dist = vert_max - vert_total
|
||||
|
||||
|
||||
copy.position.y = dist
|
||||
copy.wall_count = wall_count - 1
|
||||
copy.vert_total = dist + vert_total
|
||||
#print("Vtot: " + str(vert_total) + " Dist: " + str(dist))
|
||||
|
||||
self.add_child(copy)
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta):
|
||||
#Bee bad
|
||||
pass
|
||||
13
MiniGames/FlappyCow/World/WinText.gd
Normal file
13
MiniGames/FlappyCow/World/WinText.gd
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
extends RichTextLabel
|
||||
|
||||
@onready var Animator := $AnimationPlayer
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
visible = false
|
||||
Animator.play("Wobble")
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta):
|
||||
pass
|
||||
42
MiniGames/FlappyCow/World/World.gd
Normal file
42
MiniGames/FlappyCow/World/World.gd
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
extends Node2D
|
||||
|
||||
var badge = preload("res://Items/Badges/FlappyCowBadge.gd")
|
||||
## Switching between fullscreen and not fullscreen by pressing esc
|
||||
|
||||
func _input(_event: InputEvent) -> void:
|
||||
pass
|
||||
|
||||
var won = false
|
||||
|
||||
var timePlayed = 0
|
||||
|
||||
func _ready():
|
||||
timePlayed = 0
|
||||
|
||||
func _process(delta):
|
||||
timePlayed += delta
|
||||
|
||||
func _on_finish_line_body_entered(body):
|
||||
|
||||
if body.is_in_group("Player") and !won:
|
||||
won = true
|
||||
body.Suspend()
|
||||
$WinText.visible = true
|
||||
$YellowFlower.visible = true
|
||||
$RedFlower.visible = true
|
||||
|
||||
await get_tree().create_timer(3).timeout
|
||||
get_node("/root/MainGame/CanvasLayer/MessageZone").visible = true
|
||||
get_node("/root/MainGame/CanvasLayer/MenuBar").visible = true
|
||||
get_node("/root/MainGame/CanvasLayer/MinimizeMessageZoneButton").visible = true
|
||||
get_tree().paused = false
|
||||
InventoryManager.add_item_to_inventory(badge.new(), 1, "keyItems")
|
||||
MessageManager.item_popup(badge.new())
|
||||
LevelManager.add_XP("gaming", 400)
|
||||
AchievementManager.complete_achievement("GOTY")
|
||||
queue_free()
|
||||
# run func that ends minigame and returns a score perhaps
|
||||
|
||||
|
||||
|
||||
|
||||
215
MiniGames/FlappyCow/World/World.tscn
Normal file
215
MiniGames/FlappyCow/World/World.tscn
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue