Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ocu177/cmpt-306
1 result
Show changes
Commits on Source (12)
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf
# Godot 4+ specific ignores
.godot/
# Godot-specific ignores
.import/
export.cfg
export_presets.cfg
# Imported translations (automatically generated from CSV files)
*.translation
# Mono-specific ignores
.mono/
data_*/
mono_crash.*.json
shader_type canvas_item;
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
// Called for every pixel the material is visible on.
float r = mix(0.1, 0.8, abs(sin(TIME * 0.5))); // Red channel oscillates over time
float g = mix(0.1, 0.8, abs(sin(TIME * 0.7))); // Green channel oscillates over time
float b = mix(0.1, 0.8, abs(sin(TIME * 0.9))); // Blue channel oscillates over time
COLOR = vec4(r, g, b, 1.0f);
}
//void light() {
// Called for every pixel for every light affecting the CanvasItem.
// Uncomment to replace the default light processing function with this one.
//}
[gd_scene load_steps=9 format=3 uid="uid://bfysm1ml85vnm"]
[ext_resource type="Shader" path="res://Main Scene.gdshader" id="1_k0wfu"]
[ext_resource type="Script" path="res://player.gd" id="2_82215"]
[ext_resource type="Texture2D" uid="uid://bgjm3ihe2a70t" path="res://circle.png" id="2_r7fbb"]
[ext_resource type="PackedScene" uid="uid://c27r74scgdd0s" path="res://obstacle.tscn" id="4_yr36g"]
[ext_resource type="Script" path="res://spawn_manager.gd" id="5_yijqr"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_drp0k"]
shader = ExtResource("1_k0wfu")
[sub_resource type="GDScript" id="GDScript_4kblx"]
[sub_resource type="CircleShape2D" id="CircleShape2D_2qt3l"]
radius = 16.0
[node name="Node" type="Node"]
[node name="SpawnManager" type="Node" parent="." node_paths=PackedStringArray("target_node")]
script = ExtResource("5_yijqr")
obstacle_scene = ExtResource("4_yr36g")
target_node = NodePath("..")
[node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = -1
[node name="ColorRect" type="ColorRect" parent="CanvasLayer"]
material = SubResource("ShaderMaterial_drp0k")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Player" type="Node2D" parent="."]
script = ExtResource("2_82215")
[node name="PlayerSprite" type="Sprite2D" parent="Player"]
texture = ExtResource("2_r7fbb")
offset = Vector2(0, -100)
[node name="Area2D" type="Area2D" parent="Player/PlayerSprite"]
script = SubResource("GDScript_4kblx")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player/PlayerSprite/Area2D"]
position = Vector2(0, -100)
shape = SubResource("CircleShape2D_2qt3l")
[node name="Obstacle" parent="." instance=ExtResource("4_yr36g")]
[node name="Camera2D" type="Camera2D" parent="."]
circle.png

550 B

[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bgjm3ihe2a70t"
path="res://.godot/imported/circle.png-10953cad44a8947fbdd4128a631e9e52.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://circle.png"
dest_files=["res://.godot/imported/circle.png-10953cad44a8947fbdd4128a631e9e52.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
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
\ No newline at end of file
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://duu035687l067"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
extends AnimatableBody2D
class_name Obstacle
var shrink_speed = 1.0
var random = randf()
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
$CollisionPolygon2D.scale = Vector2.ONE*10.0
$CollisionPolygon2D.set_rotation(random)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta: float) -> void:
$CollisionPolygon2D.scale -= Vector2.ONE * shrink_speed*delta
#once tiny, delete
if $CollisionPolygon2D.scale.x < .05:
self.queue_free()
[gd_scene load_steps=2 format=3 uid="uid://c27r74scgdd0s"]
[ext_resource type="Script" path="res://obstacle.gd" id="1_ih7uq"]
[node name="Obstacle" type="AnimatableBody2D"]
script = ExtResource("1_ih7uq")
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
build_mode = 1
polygon = PackedVector2Array(-63, -87, -107, 0, -59, 95, 59, 95, 107, 0, 63, -87, 36, -73, 74, 0, 40, 65, -41, 65, -73, 0, -36, -74)
[node name="Line2D" type="Line2D" parent="CollisionPolygon2D"]
points = PackedVector2Array(-50, -80, -90, 0, -50, 80, 50, 80, 90, 0, 50, -80)
width = 30.0
extends Node2D
class_name Player
@export var move_speed := 5.0
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
$PlayerSprite/Area2D.body_entered.connect(_on_body_entered)
func _on_body_entered(body:Node2D) -> void:
print(body)
get_tree().change_scene_to_file("res://Main Scene.tscn")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _physics_process(delta: float) -> void:
self.rotation -= 0.0
if Input.is_action_pressed("ui_left"):
self.rotation -= delta*move_speed
if Input.is_action_pressed("ui_right"):
self.rotation += delta*move_speed
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=5
[application]
config/name="Assignment1"
run/main_scene="res://Main Scene.tscn"
config/features=PackedStringArray("4.3", "GL Compatibility")
config/icon="res://icon.svg"
[rendering]
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"
extends Node
class_name SpawnManager
@export var spawn_rate : float = 0.5
@export var next_time_to_spawn : float = 0.0
@export var obstacle_scene : PackedScene
@export var target_node : Node
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
assert(obstacle_scene)
assert(target_node)
next_time_to_spawn = Time.get_unix_time_from_system() + (1.0/spawn_rate)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if Time.get_unix_time_from_system() >= next_time_to_spawn:
var new_obstacle := obstacle_scene.instantiate()
target_node.add_child(new_obstacle)
next_time_to_spawn = Time.get_unix_time_from_system() + (1.0/spawn_rate)