Inital commit
This commit is contained in:
parent
22733e2780
commit
068753a961
602 changed files with 5967 additions and 0 deletions
43
scripts/player.gd
Normal file
43
scripts/player.gd
Normal file
|
@ -0,0 +1,43 @@
|
|||
extends KinematicBody2D
|
||||
|
||||
const UP = Vector2(0, -1)
|
||||
const GRAVITY = 10
|
||||
const SPEED = 90
|
||||
const JUMP_HEIGHT = -215
|
||||
|
||||
var motion = Vector2()
|
||||
var spawned = false
|
||||
|
||||
func _ready():
|
||||
$SndSpawn.play(0);
|
||||
pass
|
||||
|
||||
func _physics_process(delta):
|
||||
|
||||
motion.y += GRAVITY
|
||||
|
||||
if Input.is_action_pressed("ui_right"): #Moving Right
|
||||
motion.x = SPEED
|
||||
$Sprite.flip_h = false
|
||||
$Sprite.play("Run")
|
||||
elif Input.is_action_pressed("ui_left"): #Moving Left
|
||||
motion.x = -SPEED
|
||||
$Sprite.flip_h = true
|
||||
$Sprite.play("Run")
|
||||
else:
|
||||
motion.x = 0
|
||||
$Sprite.play("Idle")
|
||||
|
||||
if is_on_floor():
|
||||
if Input.is_action_just_pressed("ui_up"): #Jumping
|
||||
motion.y = JUMP_HEIGHT
|
||||
$SndJump.play(0)
|
||||
else:
|
||||
$Sprite.play("Jump")
|
||||
|
||||
if motion.y > 10:
|
||||
$Sprite.play("Fall")
|
||||
|
||||
#print(motion)
|
||||
motion = move_and_slide(motion, UP)
|
||||
pass
|
16
scripts/server.gd
Normal file
16
scripts/server.gd
Normal file
|
@ -0,0 +1,16 @@
|
|||
extends Node
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
#func _process(delta):
|
||||
# pass
|
Loading…
Add table
Add a link
Reference in a new issue