kobuge-games / moon-dragoon Goto Github PK
View Code? Open in Web Editor NEW2D sidescrolling shooter
Home Page: https://fry.itch.io/moon-dragoon
License: MIT License
2D sidescrolling shooter
Home Page: https://fry.itch.io/moon-dragoon
License: MIT License
Currently the player can move out of the game window on the sides (and theoretically top and bottom too, but those should not be problematic in most cases unless physics fail us).
We can do this with something like this:
func _physics_process(_delta):
# Restrict position within game screen.
if position.x < -100 or position.x > global.screen_size.x + 100:
position.x = clamp(position.x, -100, global.screen_size.x + 100)
But then if you keep trying to go too far left or right sometimes you might still end up falling through the floor, I'm not sure why yet. So opening this issue instead of pushing that workaround.
I also played with putting StaticBody2Ds on the side but then there are physics interactions against this invisible wall which are not realistic.
A more clever option could be to gradually reduce the speed of the player to force it to stop before it falls off a platform.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.