GithubHelp home page GithubHelp logo

kobuge-games / moon-dragoon Goto Github PK

View Code? Open in Web Editor NEW
12.0 6.0 1.0 3.96 MB

2D sidescrolling shooter

Home Page: https://fry.itch.io/moon-dragoon

License: MIT License

GDScript 100.00%
game godot godot-engine gameoff-2020 gamejam 2d sidescrolling shooter

moon-dragoon's People

Contributors

aaronfranke avatar akien-mga avatar fry- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

risooonho

moon-dragoon's Issues

Restrict player movement in game window

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.