Particle Game Maker Engine
1.0.0
Enables the user to create their own particle game using a simple and coherent api in the PongChamp scripting language
|
The purpose of this engine is to enable the user to make their own particle games in the PongChamp
scripting language (described below). For using the scripting API, see below. The engine can be compiled with make linux
from this directory, and then stack build
. Install stack
with https://docs.haskellstack.org/en/stable/install_and_upgrade/. To see the c API
in use, run make linux
and for more information refer to the doxygen if you don't want to use PongChamp. The advantage of PongChamp is it is easily iterable and provides a nice abstraction for using some of the apis. The c++ APIs
are also available.
Update
- Contains the available update function objectsCollision
- Contains the available collision function objectscreateParticleGroup
: ParticleGroupBuilder -> ParticleGroup
- creates a particle group from a configured builderbuildParticleGroup
: -> ParticleGroupBuilder
- creates an unconfigured particle group builderbuildLayout
: -> LayoutBuilder
- creates an unconfigured layout builderrunWithLayout
: LayoutBuilder ->
- runs your particle game with the given layout, using the preconfigured particle groupsneg
: Int -> Int
- negates a number. Negative numbers are not supported natively in PongChamp (i.e. can't be parsed).This section describes all the available functions on the global Update
object which let you describe how particle groups should update.
Move
- Move a particle by a certain X and Y offsetRandomMove
- Move a particle in a random direction within pre-defined rangesCreate
- Create any amount of a certain particle, at a certain location with some configurable randomnessLifetime
- Delete this particle after a certain number of updatesThis section describes all the available functions on the global Collision
object which let you describe how particle groups should collide.
Delete
- Delete either or both of the particles involved in the collisionCreate
- Close either or both of the particles involved in the collision a certain number of timesMove
- Move either or both particlesConvert
- Change the particle types of either or both particlesMoveRandom
- Move the primary (from) particle in a random direction, limited by a rangeParticleGroupBuilder
API REFThis section describes the available functions available on a ParticleGroupBuilder
withColor
- assigns the color of the group to the given r (int)
, g (int)
, and b (int)
withName
- sets the name of the group to the given s (string)
LayoutBuilder
API REFThis section describes the available functions available on a LayoutBuilder
withSize
- assigns the window size to the given w (int)
, h (int)
(width and height)withEditorOrientation
- assigns the editor orientation to the given o (int)
(0 for horizontal, 1 for vertical). Buttons are then placed horizontally or verticallywithWindowRatio
- determines how big the button layout should be, relative to the particle game window, given a x (int)
the particle game window will take up x
percent of the screenWelcome to our PongChamp language! This was a project that was started as a weekend thing and we plan to keep expanding on it to integrate a simple but feature-full game engine. The goal of the language is to be coupled tightly to the engine so that it can make it as easy as possible to script with it.
make all
will build the engine library for mac and windows, assuming you have the correct development libraries installed. A prebuilt version is already uploaded though.stack build
is necessary for now to build your own executable for your target architecturesdl2_ttf
, sdl2_mixer
, sdl2
, sdl2_image
mingw-w64
is neededThe simplest way to do this is to run ./bin/PongChamp [file]
. This ensures your library path is appropriately set. Since the engine-lib is not installed to your machines known library path, LD_LIBRARY_PATH
needs to be set for stack
to function correctly. If you want to run with stack
, this may serve your purposes: LD_LIBRARY_PATH=/engine-lib/ stack run -- [file]
. Note that for a Windows build to function properly the PATH
variable needs to be set, rather than LD_LIBRARY_PATH
. The python script also does this currently.
Haskell provides a FFI interface to interface with other languages. However, in order to interface with a C++ library, it is necessary to write a c wrapper around the engine and then interface with C. This engine is a great example of a cool integration with PongChamp!