Files
the-tower/README.md
Shea Frembling bab7fe1697 Create Player Controller (#4)
* add player scene

* add some logic to control player velocity

* add debug scene and reset main scene

* add sun and env to debug scene; fix normalization of movement

* add kenney WIP assets for debug

* fix movement further and add jump

* add mouse camera control

* add sprinting

* add crouching

* use constants for height

* try to improve crouching by checking to see if there is a collision above before un-crouching

* update README about line width

* move test cube in front of playercontroller
2026-02-16 16:33:45 -06:00

1.5 KiB

The Tower

Learning Resources

Branch Standards

Name branches as <you>/<topic>

Don't push to main

Create pull requests to merge in code

Code Standards

Use snake_case for variable and function names

var joe_mama := 10

func is_joe_mama(id: int) -> bool:
  if id == 10:
    return true
  else:
    return false

Use PascalCase for class names

class_name PlayerController

class EnemyProjectile

Ensure you are using types for your variables

Good:

var x: int = 10
var y := "Test" # := is the same as saying "y equals "Test" and is of type String"
func add(a: int, b: int) -> int

Bad:

var x = 10
var y = "Test"
func add(a, b)

Ensure your variables and functions have descriptive names

Good:

const PLAYER_SPEED: float = 300.0 # px/sec

Bad:

const S: 300.0

Keep single code line length up to 80 characters long. (Notice the first vertical line in the text editor.)

This keeps code easier to read because it isn't stretching all the way across the screen.

Good:

@onready var head_collision_shape: CollisionShape3D \
	= $HeadCollider/HeadCollisionShape

Bad:

@onready var head_collision_shape: CollisionShape3D = $HeadCollider/HeadCollisionShape

Notice the \ in the above "good" example. That tells Godot to continue the expression on the next line.