{"id":21915832,"url":"https://github.com/wpernath/grumpycat-melonjs","last_synced_at":"2025-03-22T09:28:25.283Z","repository":{"id":40739659,"uuid":"507488061","full_name":"wpernath/grumpycat-melonjs","owner":"wpernath","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-20T17:32:08.000Z","size":6733,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-27T09:26:36.093Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wpernath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"melonjs"}},"created_at":"2022-06-26T05:43:18.000Z","updated_at":"2022-06-26T05:43:23.000Z","dependencies_parsed_at":"2022-07-15T22:01:34.375Z","dependency_job_id":null,"html_url":"https://github.com/wpernath/grumpycat-melonjs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"melonjs/es6-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpernath%2Fgrumpycat-melonjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpernath%2Fgrumpycat-melonjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpernath%2Fgrumpycat-melonjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpernath%2Fgrumpycat-melonjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wpernath","download_url":"https://codeload.github.com/wpernath/grumpycat-melonjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244936574,"owners_count":20535035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T19:14:25.762Z","updated_at":"2025-03-22T09:28:25.261Z","avatar_url":"https://github.com/wpernath.png","language":"JavaScript","readme":"# quarkus-grumpycat / melonjs client\nThis is a refactored JavaScript / melonjs client for the game written with Quarkus / JavaScript [here](https://github.com/wpernath/quarkus-grumpycat). NOTE, that in order to run this client, you also need to start the server, as it will be used to \n- download levels\n- storing highscores\n- creating new games on the server\n- storing and reading player movements on the server\n- storing and reading enemy movements on the server\n\n\n## The Game\n\nThis game was inspired by the old Fat-Cat game and by PacMan. You're controlling a dog in a maze which needs to eat all food without being caught by a grumpy cat. \n\nRight now you can control the dog with arrow keys UP, DOWN, LEFT \u0026 RIGHT and with W, A, S, D. More keys are:\n\n- *P* PAUSE\n- *SPACE* place bomb\n- *Shift* + UP/DOWN/LEFT/RIGHT: place barrier in the direction\n\nIf the cat gets into an exploding bomb, it is stunned for 3sec. A bomb can also destroy barriers. The level ends if you got all food. \n\n## NEW \nThis engine supports a new enemy type: Spider. Spiders are not coming alone! If a spider gets into an exploding bomb, the spider will be killed. \n  \n\nGame logic is coded with [melonjs JavaScript engine](https://github.com/melonjs/melonjs)\n\n![the game](docs/the-game.png)\n\n## Running the application in dev mode\nFirst of all, you need to also run the [server part](https://github.com/wpernath/quarkus-grumpycat). Then make sure, you open `src/config.js` and change the `CONFIG.environment` variable to `local`. \n\nYou can run your application in dev mode that enables live coding using:\n```shell script\nnpm install\nnpm run dev\n```\n\n\n\n\n## Game Server\nYou have to install the quarkus part as well to run this application! Please go [there](https://github.com/wpernath/quarkus-grumpycat) and have a look. \n\n\n## Game Logic\n\n\n## Creating new Levels\nTo create a new level, fork the server part of grumpycat and download the [Tiled MapEditor](https://mapeditor.org). A `Level-Template.tmx` can be found in `/tiled` folder of the server part. \n\n## Running on Docker / Podman\nThere are container images ready to be used on [Quay.io](https://quay.io/wpernath/grumpycat-meleonjs). Use this command to pull the image to your local repository:\n\n```shell\ndocker pull quay.io/wpernath/grumpycat-melonjs\n```\n\nNote, to run the server part, you need to have a PostgreSQL database running. You can use the `docker-compose.yaml` file in `src/main/docker/` to setup a local docker / podman compose environment.\n\n```shell\ndocker-compose -f src/main/docker/docker-compose.yaml [--detach|-d] up\n```\n\nThe app is then available under `http://localhost:8081` in your browser.\n\n\n## Running on Kubernetes / OpenShift\n### OpenShift S2I\nInstalling database\n\n```shell\noc new-app postgresql-persistent \\\n\t-p POSTGRESQL_USER=cat \\\n\t-p POSTGRESQL_PASSWORD=grumpy \\\n\t-p POSTGRESQL_DATABASE=catdb \\\n\t-p DATABASE_SERVICE_NAME=catserver\n```\n\nStart building the app\n```shell\noc new-app java:openjdk-17-ubi8~https://github.com/wpernath/quarkus-grumpycat.git  --name=grumpy-cat --build-env MAVEN_MIRROR_URL=http://nexus.ci:8081/repository/maven-public/\n```\n\nExpose the service\n```shell\noc expose svc/grumpy-cat\n```\n\n### OpenShift / Kubernetes image deployment in a GitOps way\nThere are precompiled images available on `quay.io/wpernath/quarkus-grumpycat`. You can either use `latest` tag or use one of the `vx.y.z` tags.\n\nNOTE, for this approach, you need to have the `Crunchy Data Postgres Operator` installed in your Kubernetes environment. \n\nJust clone the [config repository](https://github.com/wpernath/grumpycat-config.git). Then apply the `config/overlays/dev` configuration as usual:\n\n```shell\noc new-project cat-dev\noc apply -k config/overlays/dev\n```\n\nThis will automatically install a database and the latest DEV version of the App.\n\n\n### Using full featured GitOps\nTo make use of all GitOps features, have a look at the `src/main/gitops` folder of this project. \n\nYour OpenShift / Kubernetes cluster needs to have the following Operators installed:\n\n- OpenShift Pipeline (or Tekton Pipeline)\n- OpenShift GitOps (or an ArgoCD instance)\n- Crunchy Data Postgres Operator\n\nTo install the `cat-ci` project, call:\n\n```shell\n./src/main/gitops/tekton/pipeline.sh init \\\n\t--force \\\n\t--git-user \u003cyour git user\u003e \\\n\t--git-password \u003cyour git password\u003e \\\n\t--registry-user \u003cyour quay.io user\u003e \\\n\t--registry-password \u003cyour quay.io password\u003e\n```\n\nTo install the `cat-dev` and `cat-stage` projects, call\n\n```shell\noc apply -k ./src/main/gitops/argocd\n```\n\nTo start a pipeline build, call\n\n```shell\n./src/main/gitops/tekton/pipeline.sh build \\\n\t-u \u003cyour quay.io user\u003e\n\t-p \u003cyour quay.io password\u003e\n```\n\nTo stage your version of quarkus-grumpycat, call something like\n\n```shell\n./src/main/gitops/tekton/pipeline.sh stage -r v0.2.4\n```\n\nThis creates a new branch in github.com and tags the current image on quay.io.\n\n## Roadmap\n\n- In the near future there will also be an EnemyMovementResource to store - well - the enemy's movements, as my plan to calculate new positions of the enemies based on current PlayerMovement doesn't work properly (timing issue).\n\n- Refactoring of the JavaScript stuff. I mainly have used this project to learn some JavaScript. Now it's time to refactor everything and to use some more fancy methods to do the same.\n\n- Do not directly use the Player- / EnemyMovement to store the data in the database, but use Apache Kafka or Streams to take the data and then use a Consumer to store the data asynchronously in the database. \n\n## About the graphics\nThe map graphics are coming from [LPC Terrain](https://opengameart.org/content/tiled-terrains) and all its authors. Special thanks to all of them!\n                    ","funding_links":["https://github.com/sponsors/melonjs"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpernath%2Fgrumpycat-melonjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpernath%2Fgrumpycat-melonjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpernath%2Fgrumpycat-melonjs/lists"}