Skip to content
Open
10 changes: 10 additions & 0 deletions First-outlook.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@ Heaps is powered by Haxe. Learn more about Haxe here:
- The [Haxe code cookbook](https://code.haxe.org/)
- The [Haxe community](https://community.haxe.org/)

## More on game engine development
Copy link
Copy Markdown
Contributor

@hristo-kanchev hristo-kanchev Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you delete Development.md and remove it from _Sidebar.md so we don't have duplicate information?

Also, maybe rename this header to "More on game development" instead of "More on game engine development" as the info you are sharing here doesn't directly relate to actual "engine" development.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I shifted this to a parallel pull request for the moment)


- see the "Game dev" section on the right under https://deepnight.net/tutorials/, this currently involves:
- [Entity and coordinate system](https://deepnight.net/tutorial/a-simple-platformer-engine-part-1-basics/)
- [collision checking](https://deepnight.net/tutorial/a-simple-platformer-engine-part-2-collisions/)
- [Bresenham algorithm](https://deepnight.net/tutorial/bresenham-magic-raycasting-line-of-sight-pathfinding/)

- *Game programming patterns* by Bob Nystrom ( ⚠️ code snippets in C++)
- https://gameprogrammingpatterns.com/ (also includes an open free online version of the book)

41 changes: 35 additions & 6 deletions HashLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@

[HashLink](https://hashlink.haxe.org/) is a virtual machine for the Haxe programming language. By targeting HashLink you are also able to generate Native C code for your project.

Heaps is able to support both SDL and DirectX. In order to specify which you'd like to use, you simple need to include the appropriate library when compiling your project.
HashLink is able to support both [SDL](https://lib.haxe.org/p/hlsdl) and [DirectX](https://lib.haxe.org/p/hldx). At least one and only one is required.
[OpenAL](https://lib.haxe.org/p/hlopenal) provides using sound.

For DirectX
For SDL
```hxml
-lib hlsdl
```

For DirectX (Windows)
```hxml
-lib hldx
```

For SDL
OpenAL (for sound)
```hxml
-lib hlsdl
-lib hlopenal
```

More available libraries: https://github.com/HaxeFoundation/hashlink/tree/master/libs


## Compile for HashLink:

To compile for HashLink use the following example.
Expand All @@ -28,9 +37,29 @@ To compile for HashLink use the following example.

# libraries
-lib heaps
-lib hldx
#-lib hlsdl
-lib hlsdl
#-lib hldx
-lib hlopenal

# output
-hl bin/game.hl
```


## Hot Reload

Hot reload allows to program new features into a game ***while*** it is running.

Use the following flag to allow that Hot Reload is being used.
```
-D hot-reload
```

Now run your HashLink program with
`hl --hot-reload mygame.hl`

Now everytime you re-compile, the running game also gets updated.

Note that this has its limits. Currently no new fields can be implemented. However it works well for modifying the behaviour of an already existing method (class function), for instance the `update` method and all other functions called inside it.

(See details here: https://github.com/HaxeFoundation/hashlink/wiki/Hot-Reload)