Update 010 - Year One
It have been a year since the first post in this thread
Progress is slow, but I’m glad that it’s not being abandoned by yours truly.
Animation (on Slope/Stairs)
Added two temp animation (ascend & descend) for slope/stairs. I checked the player position of y-value, compared it to previous frame, then changed the animation (with blend value) according to the return value.
Joypad
Messing around with joypad in Godot at some point and decide to test it now before it become to much pains to be implemented at later stage of development. Its not a complete implementation, but only basics just enough to make it usable.
The joypad being detected by Godot just fine. Then, the code for player and camera movement need to be adapted for joypad input. Inside _unhandled_input function, analog stick input can be measured through InputEventJoypadMotion event while button pressed can be detected through InputEventJoypadMotion.
Axis value was introduced when using analog stick which provide a value from zero/deadzone to one. For now, any value under 1.0 was clamped to 0.5 which paired with walk animation and lower speed value while at 1.0, the player will change to run animation and have higher movement speed.
That was configued only on flat plane, so movement on slope/stairs stays the same regardless the axis value from the analog stick.
For a keyboard & mouse, the input value can only be zero or one, so the animation will blend to run animation straight from idle animation since there’s also no acceleration/deceleration being implemented at current state.
func _unhandled_input(event: InputEvent) -> void:
if event is InputEventKey or event is InputEventJoypadButton:
# ... logic etc.
Not sure how most dev will handled it, but this will check both input at any input event.
Very hacky for now, but I did also implement showing input hint corresponding to latest input device. Show
‘E’ if detect keyboard & mouse input while show
‘A’ instead if joypad input is detected.
Camera
Some code refactoring (previous method seems to not behave like intended) and implement some features:
- Reset the camera view to where the player mesh is facing.
- Reset the camera and rotate its view backward.
- Change the camera pivot point, either left or right.
Hope for another year of developement 