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 (4)
Showing
with 304 additions and 0 deletions
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf
# Godot 4+ specific ignores
.godot/
/android/
[gd_scene load_steps=2 format=3 uid="uid://cityicri6eya1"]
[ext_resource type="PackedScene" uid="uid://disj0ecflhd" path="res://player.tscn" id="1_g0nsk"]
[node name="Node2D" type="Node2D"]
[node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = -1
[node name="ColorRect" type="ColorRect" parent="CanvasLayer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="Player" parent="." instance=ExtResource("1_g0nsk")]
[node name="Camera2D" type="Camera2D" parent="."]
<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://b11c3go8bhxhp"
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 RigidBody2D
class_name Player
@export var move_speed := 100.0
@export var acceleration := 10.0
@export var max_speed := 350.0
@export var screen_size = get_viewport_rect().size
@export var AnimatedSprite : AnimatedSprite2D
@export var backward_force = 1000
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass
func _on_body_entered(body:Node2D) -> void:
print(body)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
# Rotate the ship left or right based on key input
if Input.is_action_pressed("ui_left"):
apply_torque_impulse(-move_speed)
elif Input.is_action_pressed("ui_right"):
apply_torque_impulse(move_speed)
# Move the ship backward when spacebar is pressed
if Input.is_action_pressed("ui_select"): # spacebar is usually mapped to "ui_select"
var direction = transform.y.normalized() # transform.x gives the current facing direction (forward), negate it for backward
apply_central_impulse(direction * backward_force * delta)
func _physics_process(delta: float) -> void:
pass
[gd_scene load_steps=6 format=3 uid="uid://disj0ecflhd"]
[ext_resource type="Script" path="res://player.gd" id="1_t4ya0"]
[ext_resource type="Texture2D" uid="uid://jt62y8nh8x" path="res://spaceship_sprite_package_2_by_kryptid_d1y5i85-fullview-removebg.png" id="2_vfx6p"]
[sub_resource type="AtlasTexture" id="AtlasTexture_mbcsu"]
atlas = ExtResource("2_vfx6p")
region = Rect2(94, 0, 94, 100)
[sub_resource type="SpriteFrames" id="SpriteFrames_8y0oe"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_mbcsu")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_l3gel"]
radius = 50.0
[node name="Player" type="RigidBody2D" node_paths=PackedStringArray("AnimatedSprite")]
gravity_scale = 0.0
script = ExtResource("1_t4ya0")
AnimatedSprite = NodePath("AnimatedSprite2D")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
scale = Vector2(0.5, 0.5)
sprite_frames = SubResource("SpriteFrames_8y0oe")
animation = &"idle"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_l3gel")
; 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="Assignment2"
run/main_scene="res://Main Scene.tscn"
config/features=PackedStringArray("4.3", "GL Compatibility")
config/icon="res://icon.svg"
[input]
spacebar={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
]
}
rotate_right={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
rotate_left={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
[rendering]
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bry8ftr73v6o6"
path="res://.godot/imported/spaceship_sprite_package_2_by_kryptid_d1y5i85-fullview-removebg (1).png-cc0dd2c4200af5601671c31fa5de3a3e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://spaceship_sprite_package_2_by_kryptid_d1y5i85-fullview-removebg (1).png"
dest_files=["res://.godot/imported/spaceship_sprite_package_2_by_kryptid_d1y5i85-fullview-removebg (1).png-cc0dd2c4200af5601671c31fa5de3a3e.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
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ca7iswhsfde0"
path="res://.godot/imported/spaceship_sprite_package_2_by_kryptid_d1y5i85-fullview-removebg (2).png-1db431aceab093f1977ec18f79e1d3fb.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://spaceship_sprite_package_2_by_kryptid_d1y5i85-fullview-removebg (2).png"
dest_files=["res://.godot/imported/spaceship_sprite_package_2_by_kryptid_d1y5i85-fullview-removebg (2).png-1db431aceab093f1977ec18f79e1d3fb.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
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://jt62y8nh8x"
path="res://.godot/imported/spaceship_sprite_package_2_by_kryptid_d1y5i85-fullview-removebg.png-6b6c99853c33404ced56e3025f717379.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://spaceship_sprite_package_2_by_kryptid_d1y5i85-fullview-removebg.png"
dest_files=["res://.godot/imported/spaceship_sprite_package_2_by_kryptid_d1y5i85-fullview-removebg.png-6b6c99853c33404ced56e3025f717379.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
Assignment2/spaceship_sprite_package_2_by_kryptid_d1y5i85-fullview.jpg

278 KiB

[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://f4eqp5f4g886"
path="res://.godot/imported/spaceship_sprite_package_2_by_kryptid_d1y5i85-fullview.jpg-822dd5cf6efd1df224c3fe33d2b3e233.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://spaceship_sprite_package_2_by_kryptid_d1y5i85-fullview.jpg"
dest_files=["res://.godot/imported/spaceship_sprite_package_2_by_kryptid_d1y5i85-fullview.jpg-822dd5cf6efd1df224c3fe33d2b3e233.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