AdvancedPlayerController

所属分类:游戏引擎
开发工具:GDScript
文件大小:16KB
下载次数:0
上传日期:2022-07-07 11:02:38
上 传 者sh-1993
说明:  GODOT游戏引擎的动态玩家控制器
(Kinematic Player Controller for GODOT Game Engine)

文件列表:
.import (0, 2022-07-07)
.import\.gdignore (1, 2022-07-07)
.import\icon.png-487276ed1e3a0c39cad0279d744ee560.md5 (91, 2022-07-07)
.import\icon.png-487276ed1e3a0c39cad0279d744ee560.stex (1496, 2022-07-07)
Globals.gd (441, 2022-07-07)
InputManager.gd (6791, 2022-07-07)
Player.tscn (831, 2022-07-07)
PlayerController.gd (5302, 2022-07-07)
PlayerController.tscn (658, 2022-07-07)
States (0, 2022-07-07)
States\PlayerDefaultState.gd (345, 2022-07-07)
States\PlayerExampleState.gd (212, 2022-07-07)
States\PlayerState.gd (1141, 2022-07-07)
icon.png (3305, 2022-07-07)
icon.png.import (691, 2022-07-07)
script_templates (0, 2022-07-07)
script_templates\PlayerStateTemplate.gd (225, 2022-07-07)
script_templates\PlayerStateTemplate_COMMENTED.gd (1037, 2022-07-07)

# README ## Set Up ---- 1. Extract files directly into your project folder. 2. Connect templates to path Project -> Project Settings -> Application -> Editor -> Script Template Search Path 1. Edit the "Script Template Search Path" to point to "AdvancedKinematic2DPlayerController/script_templates/" OR 2. Copy contents of script_templates to your own templates folder
raw_input_struct :
Updated with every input event. This could be any number of times in a frame.
parsed_input_struct :
Updated at the start of every frame. This means inputs are polled only once in a frame. The intention is that parsed_input_struct is used by states for triggering state changes.
--- ## States --- **States** are treated similarly to cartridges for old game consoles. Each cartridge (state) contains everything needed to run itself, or it can ask the console (player_controller) to tell it a few things. When the cartridge is over, it tells the console which cartridge to insert next, but the console must actually eject and replace the cartridge. This way the decisions on which state should be next, and under what conditions a state change should occur happen entirely within the current state. **In practice the system simply assisgns a new script to the current_state node when the old state determines it is done.** i.e. A Jump state could check if the player is grounded, if so it can ask to move to a landing state/ walking state/idle state depending on the desired behavior. #JumpState func init(_args): name = "JumpState" .init(_args) *On entering the jump state, play jump animation* func on_state_enter(): .on_state_enter() anim_player.play("Jump") *When the animation is done, move to a fall state, the states are already setup to recieve signals from the attached Animation Player Node.* func on_animation_finished(_anim_name: String): .on_animation_finished(_anim_name) if _anim_name = "Jump": request_state_exit(Globals.player_states.fall, null)

近期下载者

相关文件


收藏者