This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends RigidBody3D | |
##how much vertical force | |
@export_range(750.0, 3000.0) var thrust: float = 1000.0 | |
##how much horizntal force | |
@export var torque: float = 100.0 | |
@onready var audio: AudioStreamPlayer = $Audio | |
@onready var audio_success: AudioStreamPlayer = $Audio_success | |
@onready var audio_rocket: AudioStreamPlayer3D = $Audio_rocket | |
@onready var booster_particles: GPUParticles3D = $BoosterParticles | |
@onready var explosion_particles: GPUParticles3D = $ExplosionParticles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends AnimatableBody3D | |
@export var destination: Vector3 | |
@export var duration: float = 1.0 | |
# Called when the node enters the scene tree for the first time. | |
func _ready() -> void: | |
var tween = create_tween() | |
tween.set_loops() | |
tween.set_trans(tween.TRANS_SINE) | |
tween.tween_property(self, "global_position", global_position + destination, duration) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends RigidBody3D | |
# Called every frame. 'delta' is the elapsed time since the previous frame. | |
func _physics_process(delta: float) -> void: | |
if Input.is_action_pressed("ui_accept"): | |
apply_central_force(basis.y * delta * 1000.0) | |
if Input.is_action_pressed("ui_left"): | |
apply_torque(Vector3(0.0, 0.0, 100.0 * delta)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.SceneManagement; | |
public class Player : MonoBehaviour | |
{ | |
public float moveSpeed; | |
Rigidbody2D rb; | |
// Start is called once before the first execution of Update after the MonoBehaviour is created | |
void Start() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local cubes = game.Workspace.ColorCubes:GetChildren() | |
for i = 1, #cubes do | |
cubes[i].Color = BrickColor.Random().Color | |
end | |
local function changeColor() | |
r1 = math.random(0.0, 1.0) | |
r2 = math.random(0.0, 1.0) | |
r3 = math.random(0.0, 1.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local cubes = game.Workspace.ColorCubes:GetChildren() | |
for i = 1, #cubes do | |
cubes[i].Color = BrickColor.Random().Color | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local part = script.Parent | |
local tweenService = game:GetService("TweenService") | |
local tweenInfo = TweenInfo.new(3.0, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, -1, true, 0.2) | |
local tween = tweenService:Create(part, tweenInfo, {Position = part.Position + Vector3.new(0, 20, 0)}) | |
tween:Play() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node2D | |
@onready var tile_map_layer: TileMapLayer = $TileMapLayer | |
enum farming_modes{DIRT, SEEDS, WATER, HARVEST} | |
var farming_mode_states: farming_modes = farming_modes.DIRT | |
# Called when the node enters the scene tree for the first time. | |
func _ready() -> void: | |
pass # Replace with function body. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends Node2D | |
@onready var tile_map_layer: TileMapLayer = $TileMapLayer | |
# Called when the node enters the scene tree for the first time. | |
func _ready() -> void: | |
pass # Replace with function body. | |
# Called every frame. 'delta' is the elapsed time since the previous frame. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends CharacterBody2D | |
var speed: int = 100 | |
var looking_left: bool = true | |
# Called when the node enters the scene tree for the first time. | |
func _ready() -> void: | |
pass # Replace with function body. | |
# Called every frame. 'delta' is the elapsed time since the previous frame. |