Go to file
Justus Jan Nico Wolff f7c5fa5823 „README.md“ ändern 2022-09-07 16:33:32 +02:00
README.md „README.md“ ändern 2022-09-07 16:33:32 +02:00
hashengine.py Dateien hochladen nach „“ 2022-09-07 16:28:37 +02:00
plugincompiler.py Dateien hochladen nach „“ 2022-09-07 16:28:37 +02:00
targetplugin.py Dateien hochladen nach „“ 2022-09-07 16:28:37 +02:00

README.md

hashengine-copyright-justus-2022

if you want to edit it and publish it give credit's to me

how to use the module:

the game class:

at the beginning of every hashengine game you need to initialize the engine. thats automaticlly being made if you declear a variable to the game class, it will automaticlly install all dependencies

to get keys that are being pressed get the keys dictionary from the game class: game.pressedkeys

to play sounds use game.playsound as the path you give the path to the sound file, waitforfinish tells if the hashengine should wait with further code execution until the sound is done playing normal its set to False

the update function is being used for updating all objects in the game and also for updating the pressedkeys dictionary

to add a object you call the addobj function in the game class and pass the object class

the object class:

the object class is used for objects in the game it stores data about the object but the calculating is doing the game not the object class itself

when you declear the object class then you need to pass this argument: character. this tells how the object should look like in the game example: we give the object class the character "#" so when we add it in the game with addobj() then it shows up as "#"

the rest of the arguments are optional: gravity selects the gravity for the object. normally 0.1 x selects the x starting position. normally 0 y selects the y starting position. normally 0 antixforce selects the braking when moving left or right. normally 0.1

the object class also has xvelocity and yvelocity, they are used to move the object around example: yvelocity is being set to 1: then the object would fly up, height is depending on gravity the same is with xvelocity but the xvelocity "gravity" is antixforce

demo pong Programm

Heres a link to a pong Programm that I made with hash engine: https://git.l--n.de/justuswolff/hashengine_pong/src/branch/master/

plugins

the new hashengine has a plugin system and theres a plugincompiler and a targetplugin file in the targetplugin file you write plugins, and at the beginning it is a template plugin. the #before is a marker and it marks for the compiler that when the update function was called it will be executed before the calculations the #after marks that the code is run after the calculations and showing of the game plugins need to be located under the plugins folder to be found.

!WARNING!

malicious plugins are possible so be warned about them!