Giter Site home page Giter Site logo

annoraaq / grid-engine Goto Github PK

View Code? Open in Web Editor NEW
214.0 214.0 18.0 45.45 MB

A grid based movement engine compatible with Phaser3.

Home Page: https://annoraaq.github.io/grid-engine/

License: Apache License 2.0

TypeScript 99.46% JavaScript 0.32% HTML 0.22%
game-development grid-movement phaser tile

grid-engine's Introduction

Annoraaq's GitHub stats

grid-engine's People

Contributors

annoraaq avatar danielart avatar dependabot[bot] avatar github-actions[bot] avatar jasoncabot avatar therebelrobot avatar zewa666 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

grid-engine's Issues

gm_alwaysTop property bug

Hi. I have tilemap with 3 layers: ground, misc1 and misc2. Layer misc2 have property gm_alwaysTop with checked checkbox. But layer misc1 rendered at the top of player instead of misc2. Layer misc1 not have any properties.

One-way collision detection

Hey there! Love the project, happy to see grid based movement get the love it deserves.

One improvement I think would help significantly is Tiled custom properties support for one-way collision, i.e. I can set collideOnly: UP to a tile and so you can walk through it from any direction but the top.

I'll also try and look into contributing on this idea as well.

Thanks!

Need branch for documentation update

Hey there! I'm ready to submit a PR for the big documentation update. We're going to need a gh-pages branch that's empty so we can merge the site directly over. The repository should also be set up to serve the Pages site from the gh-pages / (root).

Will be happy to continue contributing to documentation as time goes forward, including the API documentation I'm still working on. ๐Ÿ˜„

Typescript

Hi there!

Looking to try out your plugin into a Typescript project. Would be great if you can expose type declarations along with your package!

Could not find a declaration file for module 'phaser-grid-movement-plugin'. '/myproject/node_modules/phaser-grid-movement-plugin/dist/GridMovementPlugin.min.js' implicitly has an 'any' type.
  Try `npm install @types/phaser-grid-movement-plugin` if it exists or add a new declaration (.d.ts) file containing `declare module 'phaser-grid-movement-plugin';`  TS7016

Migrate documentation from Jekyll to custom SSG

Having a lot of dependency issues with keeping the current Jekyll-based documentation consistent. I'll be shifting our documentation over to Hugo since it seems a lot more consistent than Jekyll.

All this means is that adding documentation might require a build step - something I might be able to automate through GitHub Actions. This is just a wip plan at the moment.

Add destroy() method

Hi there. I want to suggest to add destroy() method to the plugin. It will be useful on such cases like restart scene (i do it and have large memory leaks) and etc. I need to clearup resources like characters data, created animations by plugin etc.

Migrate to esbuild, clean up repo

Hey again! Did some actually useful work on the project itself this time around! Here's the proposal, and a PR will be made to address this as well.

  • The plugin is using Webpack. Webpack is powerful, and very useful, but it's bulky, slow, and requires quite a bit of config - this is evidenced by the big webpack.config.js that even this small project has, as well as the numerous installed plugins you can find in package.json.
  • As such, I am proposing that we move to the esbuild bundler, which is lightning fast and has built-in support for the main features this plugin uses. I get a slightly smaller build size (1.0mb vs 1.16mb) at a faster speed (216ms-231ms).
  • Thanks to the migration to esbuild, I was able to clean up the package.json of most of the dependencies we had, and remove webpack.config.js and tsconfig.json, while retaining all the features.
  • Additionally, we are no longer building into a UMD format, but instead are building an IIFE module. The global name of the module can be easily adjusted at the --global-name flag in the build script in package.json.

I have tested these changes and they are a working drop-in replacement for the current distribution of the plugin, but make it much more ergonomic to contribute to the plugin - as well as use it.

You can see it working perfectly at the basic movement demo on my version of the docs.

Follow: Timing problem

When following another player there is a delay that can add up and slow down the follower. One way to avoid this is to synchronize all actions in the update function

Readme updates, with labels

Just a bunch of stylistic and English changes for the readme.md file, as well as some image labels I created for the repo. Shouldn't need to make any changes to the readme when merging, I'm pretty sure it'll work 100%

Phaser container support

Hi. I want suggest to add for containers support. It will be useful for character sprite with name.

Adding players on the go

Hi. Can i add more players when they r appeared at current location? I want create realtime rpg

Player position changed when bumping into borders of tilemap

Hello,
thank you for such a wonderfully easy plugin to use. It does everything I need and more
the only problem I have found is that when my player walks to the edge of the tilemap and collides with the border. The position of the player is updated and thus unaligns with the tilemap.
I'm sure there is a solution, but I am not familiar enough with phaser or your plugin to figure it out, my apologies.
PlayerOutline
PlayerInline

In the top picture the player can be seen between two tiles

Event Properties with Callbacks

Hey again!

In the game I am creating, it will be necessary to be able to know when I am interacting with certain tiles on the map. Since the plugin is the one handling collision checks and movement, I suggest a number of properties that could be super useful for map events. I'll also give a use case for each event, but these mechanics would be implemented by the game developer. I am only suggesting we add properties for certain tilemap-based events.

  • onEnter - this event would trigger any time a certain tile has been entered. This could be used in such cases as initiating fights, minigames or puzzle mechanics.

  • onStanding - this event will trigger every frame that the character is standing on the given tile. This could be used for automated platforms for puzzles, weight buttons or healing pads.

  • onExit - this event will trigger when the character leaves a given tile. This could be used to trigger trap doors, or other cinematic effects such as rockslides behind the player.

  • onFacing - this event could be triggered when the player is adjacent to and facing the given tile. This could be used to initiate interactions with objects, dialog with NPCs, et cetera. This would, however, require adding a "facing" mechanic to the plugin itself to implement.

The uses for such events are immense; players could define "trigger" areas on a tilemap that would start certain events or cinematics, and it would facilitate a lot of dynamic interactions with the world such as dialogs, shops, puzzles, platforms, et cetera.

Rebrand and refactor to GridEngine

Man, it's a busy day!

So per the discussion #67 where Johannes agreed that GridEngine sounded cool, I decided to go ahead and try a quick and dirty refactor of the plugin. I am pleased to announce that this refactor was successful!

I was able to get the plugin renamed to GridEngine, and all API calls now use this.gridEngine to access. There were no compatibility issues in any of the tests I performed, and I'll be updating the docs to use the GridEngine edition of the plugin when/if this gets approved.

Of course, there remains updating the repo here, updating the NPM registry, et cetera.

However, I can't make a PR unless Johannes approves the #70 PR and merges it, so I can rebase the branch and not double up on commits.

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.