generated from deepnight/gameBase
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d1eb73e
Showing
68 changed files
with
8,980 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: deepnight |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Test JS build | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
build: | ||
|
||
strategy: | ||
matrix: | ||
os: [windows-latest] | ||
haxe: [4.3.3] | ||
fail-fast: true | ||
runs-on: windows-latest | ||
|
||
steps: | ||
# Checkout & install haxe | ||
- uses: actions/checkout@v2 | ||
- uses: krdlab/setup-haxe@v1 | ||
with: | ||
haxe-version: ${{ matrix.haxe }} | ||
- run: haxe -version | ||
|
||
# Install libs | ||
- run: haxe setup.hxml | ||
- run: haxelib list | ||
|
||
# Try to build | ||
- run: haxe build.js.hxml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
redist/ | ||
bin/ | ||
dump/ | ||
res/.tmp/ | ||
res/**/backups/ | ||
|
||
# VScode | ||
.vscode/settings.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"skipTerminateQuickPick": true, | ||
"skipSwitchToOutput": false, | ||
"skipErrorMessage": true, | ||
"commands": [ | ||
{ | ||
"text": "🍊 DX", | ||
"color": "orange", | ||
"commandType":"exec", | ||
"command": "haxe build.directx.hxml", | ||
"alignment": "right", | ||
"skipTerminateQuickPick": false, | ||
"priority": -9 | ||
}, | ||
{ | ||
"text": "🍊 OpenGL", | ||
"color": "orange", | ||
"commandType":"exec", | ||
"command": "haxe build.opengl.hxml", | ||
"alignment": "right", | ||
"skipTerminateQuickPick": false, | ||
"priority": -10 | ||
}, | ||
{ | ||
"text": "Run HL", | ||
"color": "orange", | ||
"command": "hl bin/client.hl", | ||
"alignment": "right", | ||
"skipTerminateQuickPick": false, | ||
"priority": -11 | ||
}, | ||
{ | ||
"text": "☕ JS", | ||
"color": "yellow", | ||
"commandType":"exec", | ||
"command": "haxe build.js.hxml", | ||
"alignment": "right", | ||
"skipTerminateQuickPick": false, | ||
"priority": -20 | ||
}, | ||
{ | ||
"text": "Run JS", | ||
"color": "yellow", | ||
"command": "start run_js.html", | ||
"alignment": "right", | ||
"skipTerminateQuickPick": false, | ||
"priority": -21 | ||
}, | ||
{ | ||
"text": "🅰️ Lang", | ||
"color": "white", | ||
"command": "haxe tools.langParser.hxml", | ||
"alignment": "right", | ||
"skipTerminateQuickPick": false, | ||
"priority": -40 | ||
}, | ||
{ | ||
"text": "📦 Redist", | ||
"color": "lightgreen", | ||
"command": "haxelib run redistHelper build.directx.hxml build.opengl.hxml build.js.hxml -o redist -p GameBase -zip", | ||
"alignment": "right", | ||
"skipTerminateQuickPick": false, | ||
"priority": -50 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "HL debug", | ||
"request": "launch", | ||
"type": "hl", | ||
"cwd": "${workspaceRoot}", | ||
"preLaunchTask": "HaxeActiveConf" | ||
}, | ||
{ | ||
"name": "Chrome JS debug", | ||
"request": "launch", | ||
"type": "chrome", | ||
"file": "${workspaceFolder}/run_js.html", | ||
"preLaunchTask": "HaxeActiveConf" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "HaxeActiveConf", | ||
"type": "haxe", | ||
"args": "active configuration", | ||
"problemMatcher": [ | ||
"$haxe-absolute", | ||
"$haxe", | ||
"$haxe-error", | ||
"$haxe-trace" | ||
], | ||
"presentation": { | ||
"reveal": "never", | ||
}, | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# GameBase changelog | ||
|
||
## 2.0 | ||
|
||
- General: | ||
- **The official gameBase version is now the former "advanced" branch version. The previous, more minimalistic version, is still available in the `legacy` branch.** | ||
- **Debug Drone**: press `CTRL-SHIFT-D` to spawn a debug Drone. Use arrows to fly around and quickly explore your current level. You can also type `/drone` in console. | ||
- Full **Controller** rework, to provide much better Gamepad support, bindings, combos, etc. | ||
- Full **LDtk** integration (https://ldtk.io), with hot-reloading support. | ||
- Added many comments everywhere. | ||
- Moved all source code to various `src/` subfolders | ||
- Moved all assets related classes to the `assets.*` package | ||
- Added various debug commands to console. Open it up by typing `/`. Enter `/help` to list all available commands. | ||
- Added `/fps` command to console to display FPS chart over time. | ||
- Added `/ctrl` command to visualize and debug controller (keyboard or gamepad). | ||
- Fixed various FPS values issues | ||
- Better "active" level management, through `startLevel()` method | ||
- Cleaned up Main class | ||
- Renamed Main class to App | ||
- Renamed Data class to CastleDb | ||
- Replaced pixel perfect filters with a more optimized one (now using `Nothing` filter) | ||
- Added many comments and docs everywhere | ||
- Added XML doc generation for future proper doc | ||
- Removed SWF target (see you space cowboy) | ||
- Added this CHANGELOG ;) | ||
|
||
- Entity: | ||
- All entities now have a proper width/height and a pivotX/Y factor | ||
- Separated bump X/Y frictions | ||
- Fixed X/Y squash frictions (forgot to use tmod) | ||
- Added a `sightCheck` methods using Bresenham algorithm | ||
- Added `isAlive()` (ie. quick check to both `destroyed` flag and `life>0` check) | ||
- Added `.exists()` to Game and Main | ||
|
||
- Camera: | ||
- Cleanup & rework | ||
- Added zoom support | ||
- Camera slows down when reaching levels bounds | ||
- Camera no longer clamps to level bounds by default | ||
- Added isOnScreen(x,y) | ||
|
||
- UI: | ||
- Added basic notifications to HUD | ||
- Added debug text field to HUD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Sébastien Bénard | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# About | ||
|
||
**A lightweight and simple base structure for games, using _[Heaps](https://heaps.io)_ framework and _[Haxe](https://haxe.org)_ language.** | ||
|
||
Latest release notes: [View changelog](CHANGELOG.md). | ||
|
||
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/deepnight/gameBase/test.js.yml)](https://github.com/deepnight/gameBase/actions/workflows/test.js.yml) | ||
[![GitHub Repo stars](https://img.shields.io/github/stars/deepnight/gameBase?label=%E2%98%85)](https://github.com/deepnight/gameBase) | ||
|
||
# Install | ||
|
||
## Legacy or master? | ||
|
||
Two separate branches exist for GameBase: | ||
|
||
- `master`: latest GameBase version, actively maintained. | ||
- `legacy`: the previous Gamebase version. This one is much more minimalistic but it could be useful if you were looking for a very basic framework for Heaps+Haxe. | ||
|
||
The following document will only refer to the `master` branch. | ||
|
||
## Getting master | ||
|
||
1. Install **Haxe** and **Hashlink**: [Step-by-step tutorial](https://deepnight.net/tutorial/a-quick-guide-to-installing-haxe/) | ||
2. Install required libs by running the following command **in the root of the repo**: `haxe setup.hxml` | ||
|
||
# Compile | ||
|
||
From the command line, run either: | ||
|
||
- For **DirectX**: `haxe build.directx.hxml` | ||
- For **OpenGL**: `haxe build.opengl.hxml` | ||
- For **Javascript/WebGL**: `haxe build.js.hxml` | ||
|
||
The `build.dev.hxml` is just a shortcut to one of the previous ones, with added `-debug` flag. | ||
|
||
Run the result with either: | ||
|
||
- For **DirectX/OpenGL**: `hl bin\client.hl` | ||
- For **Javascript**: `start run_js.html` | ||
|
||
# Full guide | ||
|
||
An in-depth tutorial is available here: [Using gamebase to create a game](https://deepnight.net/tutorial/using-my-gamebase-to-create-a-heaps-game/). Please note that this tutorial still refers to the `legacy` branch, even though the general idea is the same in `master` branch. | ||
|
||
## Sample examples | ||
|
||
The samples are the recommended places to start for the latest `GameBase` version (`main`). | ||
|
||
They should give a pretty hands-on understanding of how entities work and how to integrate `ldtk` to development. | ||
|
||
`SamplePlayer.hx`[SamplePlayer.hx] | ||
|
||
SamplePlayer is an Entity with some extra functionalities: | ||
|
||
- user controlled (using gamepad or keyboard) | ||
- falls with gravity | ||
- has basic level collisions | ||
- some squash animations, because it's cheap and they do the job | ||
|
||
`SampleWorld.hx` | ||
|
||
A small class that just creates a SamplePlayer instance in the sample level. | ||
|
||
## Localization | ||
|
||
For **localization support** (ie. translating your game texts), you may also check the [following guide](https://deepnight.net/tutorial/part-4-localize-texts-using-po-files/). | ||
|
||
## Questions | ||
|
||
Any question? Join the [Official Deepnight Games discord](https://deepnight.net/go/discord). | ||
|
||
# Cleanup for your own usage | ||
|
||
You can safely remove the following files/folders from repo root: | ||
|
||
- `.github/` | ||
- `LICENSE` | ||
- `README.md` | ||
- `CHANGELOG.md` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-cp src/game | ||
|
||
-lib castle | ||
-lib heaps | ||
-lib hscript | ||
-lib deepnightLibs | ||
-lib ldtk-haxe-api | ||
-lib heaps-aseprite | ||
|
||
-main Boot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build.directx.hxml | ||
-debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
_base.hxml | ||
-D windowSize=1280x720 | ||
-hl bin/client.hl | ||
-lib hldx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
_base.hxml | ||
-dce std | ||
-js bin/client.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
_base.hxml | ||
-D windowSize=1280x720 | ||
-hl bin/client.hl | ||
-lib hlsdl |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"myJsonConstant": 2 | ||
} |
Oops, something went wrong.