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 = 250 | |
func _process(delta: float) -> void: | |
player_movement() | |
func player_movement() -> void: | |
velocity = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down") | |
velocity = velocity.normalized() * speed |
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 | |
@onready var bullet_spawn_point: Marker2D = $BulletSpawnPoint | |
@onready var bullet = preload("res://bullet.tscn") | |
var speed: int = 75 | |
var direction: Vector2 = Vector2() | |
func _physics_process(delta: float) -> void: | |
var input_dir = Vector2(Input.get_axis("ui_left", "ui_right"), Input.get_axis("ui_up", "ui_down")).normalized() | |
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
func _on_body_entered(body: Node2D) -> void: | |
print("contacted") | |
body.enable_process(false) | |
DialogueManager.show_example_dialogue_balloon(load("res://dialogue.dialogue"), "start") | |
body.enable_process(true) |
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 | |
func _physics_process(delta: float) -> void: | |
player_input() | |
func player_input() -> void: | |
if Input.is_action_just_pressed("move_right"): | |
velocity = Vector2.RIGHT | |
move(velocity) | |
if Input.is_action_just_pressed("move_left"): |
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 Area2D | |
var rotate_speed : float = 3.0 | |
var bob_height: float = 5.0 | |
var bob_speed: float = 5.0 | |
@onready var start_position: Vector2 = global_position | |
@onready var sprite = $Sprite2D | |
func _physics_process(delta: float) -> void: |
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 Area2D | |
@export var move_direction: Vector2 | |
@export var move_speed: float = 100 | |
@onready var marker_2d: Marker2D = $Marker2D | |
@onready var start_position: Vector2 = global_position | |
@onready var target_position: Vector2 = marker_2d.global_position |
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 | |
@export var move_speed: float = 200 | |
@export var acceleration: float = 50 | |
@export var braking: float = 20 | |
@export var gravity: float = 500 | |
@export var jump_force: float = 250 | |
@onready var sprite: Sprite2D = $Sprite | |
@onready var anim: AnimationPlayer = $AnimationPlayer |
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 Area2D | |
var direction : Vector2 = Vector2.ZERO | |
var speed: int = 350 | |
var can_move : bool = true | |
var min_positions: Vector2 = Vector2(20, 176) | |
var max_positions: Vector2 = Vector2(520, 730) | |
func _process(delta: float) -> void: | |
if can_move: |
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 Control | |
var pressed_position: Vector2 | |
var release_position: Vector2 | |
func _input(event: InputEvent) -> void: | |
if Input.is_action_just_pressed("click"): | |
pressed_position = event.position | |
if Input.is_action_just_released("click"): |
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 Control | |
var pressed_position: Vector2 | |
var release_position: Vector2 | |
func _input(event: InputEvent) -> void: | |
if Input.is_action_just_pressed("click"): | |
pressed_position = event.position | |
if Input.is_action_just_released("click"): |
NewerOlder