Improve the official 2D Platformer demo
johnnygossdev opened this issue · 12 comments
The 2D Platformer is the first demo to be reworked into the Best Practices guidelines as discussed in #56.
The work-in-progress project can be found on the feature/demo-platformer-2d
branch.
I've made some notes of the changes I'd like to implement. Feedback is welcome!
General
- Code adheres to Guidelines
- Port to 3.2
- Restructure project folders
- Allow for Hidpi
- Smaller stage with less scenes. (There are a lot of scenes which might be overwhelming for beginners)
- Add fail state and win state
- Remove TilesetEdit scene.
- Remove the rotated Still platforms in favour of using the TileMap. (Having to manually place Still platforms to be pixel perfect seems redundant with a TileMap)
Player
- Player movement is too floaty / slidy. Make it more responsive. (Will look at other examples of responsive platformers to try and emulate them.)
- Add
jumping_weapon
andfalling_weapon
animations - Add longer jump when jump button held down. Allow for hops.
- Move touch UI out of Player Scene or remove the touch controls in favour of a separate demo.
- Change Bullet to have more impact. (Have it be a laser instead?)
Enemies
- Improve death animation.
- Damages the player when Player contacts them. (Reset scene on contact?)
Moving Platforms
Use Path2D for movement?(Doesn't behave well withsync_to_physics
)
Bugs
- Player slides along moving platforms
- Shooting occasionally doesn't work when the button is pressed. (After several jumps, the first shot doesn't fire. Issue with having it in
_phyisics_process
?) - Player slides to the left / right upon landing when jumping against a wall.
- Bullets can be shot inside walls if right next to them
- Bullets are able to be shot into the walls at a distance. (Looks like the high speed of them could be a cause)
- Player slides down slopes slightly when jumping on a slope. This is a known issue in Godot (30777)
Great plan! A little extra: as Godot 3.2 is coming out soon, could you port it to Godot 3.2? The 2d part is already quite stable, even using the official alphas.
Cheers! That's a good idea. I'll also port it to 3.2 👍
As the character is a KinematicBody2D I'd take the opportunity to use the recent move and slide with snap to make it not slide down on slopes.
So I'm not sure what the scope of this demo is. It seems to me more of a clone type of demo trying to be a somewhat finished project instead of a "feature demo". So because of that I'd say:
- let's keep the touch controls in to make it "more complete"
- perhaps add menu & death/score scenes
Let's not increase the scope with UI scenes. We already have a complete demo of our own for that: https://github.com/GDquest/Your-First-Game-Godot-2d-Platformer
This platformer code rewrite is a prototype to show what our styleguide, comments, etc. can bring to the official demos repo, so people can see the improvements we can bring to the table.
I didn't think what I'm proposing to be a huge amount of extra work. Maybe menu & death/score is out of scope, but I don't really see a problem in keeping the touch controls.
The project runs fine on 3.2 Beta1.
I think a simple defeat/win overlay would be nice but I'll just refactor what's there without adding anything to tick off the aim. We can always assess after that.
Will this be merged back into godot-demo-projects
after 3.2 is released? Also note that there have been minor changes to the version on godot-demo-projects
since, including ultra-wide support, so there will be some conflicts (it would probably be easiest to resolve all in favor of this version and then check that the demo project still works correctly with all its features).
Thanks for the heads up!
I think we'd like it to be but I'm not sure on the status. @NathanLovato might have more information
@aaronfranke Yes, we made this as a contribution and proof of concept for a proposal to improve the quality of the official demos.
This demo is a +/- complete remake of the platformer. Johnny entirely rewrote the code to make it teach good practices, made a new level... It would replace the original code, leading to no conflicts. We can replicate new features added to the official demo, no problem.
We talked about improving and remaking official demos at GodotCon with Rémi and Juan, who approved our idea and plan. We had to get the GDScript styleguide improvements first, and now we're missing a clear design goal for the demos that everyone could follow, and that we could use to improve the overall quality of the repo.
This PR is an example of what we intend to contribute, in terms of code quality and educational value. We should probably move it to its own repo for now, so people can see and test it, and open a PR and discussion for the Godot demos repo. Sounds good to you, @johnnygossdev ?
Sounds good to me!