commit 1d1c452fa2a35633fa5f5d404dcccdaa8be4f3e5 Author: JeremyStarTM Date: Sat Jun 18 13:05:48 2022 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..34ad90f --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +.import +.vscode + +# Godot-specific ignores +.import/ +export.cfg +export_presets.cfg + +# Imported translations (automatically generated from CSV files) +*.translation + +# Mono-specific ignores +.mono/ +data_*/ + +/addons/godot-plugin-refresher diff --git a/AndinaFont.ttf b/AndinaFont.ttf new file mode 100644 index 0000000..78496af Binary files /dev/null and b/AndinaFont.ttf differ diff --git a/BugScripts/Player.gd.idkbug b/BugScripts/Player.gd.idkbug new file mode 100644 index 0000000..7966eaf --- /dev/null +++ b/BugScripts/Player.gd.idkbug @@ -0,0 +1,121 @@ +###################### +### Jessist Script ### +###################### +# This script is part of Jessist +# Jessist is licensed under GNU GPLv3 +# +# This script manages the player object +extends AnimatedSprite + +class_name Player + +# Animation and code stuff +var developmentVersion = true +var verboseMessages = true +var playerAction = null +var playerFacing = null + +# Player information +export var playerJump = 600#*1.5 +export var playerJumpActive = false +export var playerJumpCurrent = 0 +export var playerSpeed = 175 +#export var playerSpeed = 500 +export var gravitySpeed = 600 +export var currentLevel = 0 +export var position_y = 0 +export var position_x = 0 +export var collectables = 0 +export var powerup_speed = false +export var gravityVector = 0 +export var moveVector = Vector2(0,0) +export var noGravity = 0 + +# Cheats +var cheats_fly = false + +func _ready(): + if not developmentVersion: + verboseMessages = false + print("=> Initializing player object") + playerAction = "STANDING" + playerFacing = "RIGHT" + +func _process(delta): + animManager() + cheatManager() + moveVector.x = 0 + if cheats_fly: + gravityVector = 0 + noGravity = 0 + else: + if not noGravity == 0: + print("==> noGravity is at " + String(noGravity)) + noGravity -= 1 + gravityVector = 0 + else: + gravityVector += gravitySpeed * delta + if gravityVector > 1600: + gravityVector = 1600 + if verboseMessages: + print("==> gravityVector above 1600, throttling") + inputHandler() + if playerJumpActive: + if playerJumpCurrent >= playerJump: + noGravity = 0 + playerJumpActive = false + playerJumpCurrent = 0 + else: + if playerJumpCurrent >= 500: + playerJumpCurrent += (playerJump / 2) * delta -2500 + else: + playerJumpCurrent += (playerJump / 2) * delta + gravityVector -= playerJumpCurrent + noGravity = 1 + moveVector.y += gravityVector + if verboseMessages: + print("==> Current velocity: x" + String(moveVector.x) + " y" + String(moveVector.y)) + get_parent().move_and_slide(moveVector,Vector2(0,-1)) + +func animManager(): + if playerFacing == "LEFT": + animation = "WalkingLeft" + elif playerFacing == "RIGHT": + animation = "WalkingRight" + if playerAction == "WALKING" or playerAction == "JUMPING": + playing = true + else: + frame = 0 + playing = false + +func cheatManager(): + if Input.is_action_just_pressed("cheats_fly"): + if cheats_fly: + cheats_fly = false + print("=> CHEATS: cheats_fly is off") + else: + cheats_fly = true + print("=> CHEATS: cheats_fly is on") + +func inputHandler(): + if Input.is_action_pressed("ui_left"): + if verboseMessages: + print("==> Left pressed") + playerFacing = "LEFT" + playerAction = "WALKING" + moveVector.x = moveVector.x-playerSpeed + elif Input.is_action_pressed("ui_right"): + if verboseMessages: + print("==> Right pressed") + playerFacing = "RIGHT" + playerAction = "WALKING" + moveVector.x = moveVector.x+playerSpeed + elif Input.is_action_just_pressed("ui_up"): + if verboseMessages: + print("==> Up pressed") + if get_parent().is_on_floor(): + playerAction = "JUMPING" + playerJumpActive = true + noGravity = 60 + else: + playerAction = "STANDING" diff --git a/BugScripts/Player.gd.jumpbug b/BugScripts/Player.gd.jumpbug new file mode 100644 index 0000000..f11b05c --- /dev/null +++ b/BugScripts/Player.gd.jumpbug @@ -0,0 +1,121 @@ +###################### +### Jessist Script ### +###################### +# This script is part of Jessist +# Jessist is licensed under GNU GPLv3 +# +# This script manages the player object +extends AnimatedSprite + +class_name Player + +# Animation and code stuff +var developmentVersion = true +var verboseMessages = true +var playerAction = null +var playerFacing = null + +# Player information +export var playerJump = 600#*1.5 +export var playerJumpActive = false +export var playerJumpCurrent = 0 +export var playerSpeed = 175 +#export var playerSpeed = 500 +export var gravitySpeed = 600 +export var currentLevel = 0 +export var position_y = 0 +export var position_x = 0 +export var collectables = 0 +export var powerup_speed = false +export var gravityVector = 0 +export var moveVector = Vector2(0,0) +export var noGravity = 0 + +# Cheats +var cheats_fly = false + +func _ready(): + if not developmentVersion: + verboseMessages = false + print("=> Initializing player object") + playerAction = "STANDING" + playerFacing = "RIGHT" + +func _process(delta): + animManager() + cheatManager() + moveVector.x = 0 + if cheats_fly: + gravityVector = 0 + noGravity = 0 + else: + if not noGravity == 0: + print("==> noGravity is at " + String(noGravity)) + noGravity -= 1 + gravityVector = 0 + else: + gravityVector += gravitySpeed * delta + if gravityVector > 1600: + gravityVector = 1600 + if verboseMessages: + print("==> gravityVector above 1600, throttling") + if playerJumpActive: + if playerJumpCurrent >= playerJump: + noGravity = 0 + playerJumpActive = false + playerJumpCurrent = 0 + else: + if playerJumpCurrent >= 500: + playerJumpCurrent += (playerJump / 2) * delta -2500 + else: + playerJumpCurrent += (playerJump / 2) * delta + gravityVector -= playerJumpCurrent + noGravity = 1 + moveVector.y = +gravityVector + inputHandler() + if verboseMessages: + print("==> Current velocity: x" + String(moveVector.x) + " y" + String(moveVector.y)) + get_parent().move_and_slide(moveVector,Vector2(0,-1)) + +func animManager(): + if playerFacing == "LEFT": + animation = "WalkingLeft" + elif playerFacing == "RIGHT": + animation = "WalkingRight" + if playerAction == "WALKING" or playerAction == "JUMPING": + playing = true + else: + frame = 0 + playing = false + +func cheatManager(): + if Input.is_action_just_pressed("cheats_fly"): + if cheats_fly: + cheats_fly = false + print("=> CHEATS: cheats_fly is off") + else: + cheats_fly = true + print("=> CHEATS: cheats_fly is on") + +func inputHandler(): + if Input.is_action_pressed("ui_left"): + if verboseMessages: + print("==> Left pressed") + playerFacing = "LEFT" + playerAction = "WALKING" + moveVector.x = moveVector.x-playerSpeed + elif Input.is_action_pressed("ui_right"): + if verboseMessages: + print("==> Right pressed") + playerFacing = "RIGHT" + playerAction = "WALKING" + moveVector.x = moveVector.x+playerSpeed + elif Input.is_action_just_pressed("ui_up"): + if verboseMessages: + print("==> Up pressed") + if get_parent().is_on_floor(): + playerAction = "JUMPING" + playerJumpActive = true + noGravity = 60 + else: + playerAction = "STANDING" diff --git a/BugScripts/README.md b/BugScripts/README.md new file mode 100644 index 0000000..6c1c4cb --- /dev/null +++ b/BugScripts/README.md @@ -0,0 +1 @@ +This directory contains buggy scripts that can be tried out at your own risk. They are mostly funny glitches. All bugs are named after this schema: ***