From f0b18e4976ac5b2dd651391de6185f95f7bc0b73 Mon Sep 17 00:00:00 2001 From: Justus Jan Nico Wolff Date: Fri, 5 Aug 2022 21:30:40 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/README.md b/README.md index 11a53b4..0a78fde 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,51 @@ # hashengine-copyright-justus-2022 +# run the demo programm +to run the demo programm just execute the module and make sure you have these modules installed: +time +ctypes +os +keyboard + +# what modules the hashengine need: + +the hashengine module needs the os module + +# how to use the module + +how to make an box that spawns in air: +```python +import time #imports the time module +import main #imports the hashengine module +game = main.game() # makes a variable with the game instance +box = main.object("#", y=10, gravity=0.1, antixforce=1) # creates the box antixforce selects the braking gravity selects the gravity y selects the y start position x selects the x start position character selects what character the object should be in our case a hashtag just experiment with the settings and you may programm something cool! +game.addobj(box) # adds the box to the game so the game knows that it exists +while True: + game.update() # makes an update for every object in the game + time.sleep(0.05) + +``` + +if you want to control the hashtag use this code: +```python + +import time #imports the time module +import main #imports the hashengine module +game = main.game() # makes a variable with the game instance +box = main.object("#", y=10, gravity=0.1, antixforce=1) # creates the box antixforce selects the braking gravity selects the gravity y selects the y start position x selects the x start position character selects what character the object should be in our case a hashtag just experiment with the settings and you may programm something cool! +game.addobj(box) # adds the box to the game so the game knows that it exists +while True: + if keyboard.is_pressed("d"): + box.xvelocity -= 1 # sets it xvelocity experiment with it and you find out its for movement + elif keyboard.is_pressed("a"): + box.xvelocity += 1 # sets it xvelocity experiment with it and you find out its for movement + elif keyboard.is_pressed("w"): + box.yvelocity += 1 # sets it yvelocity experiment with it and you find out its for movement + elif keyboard.is_pressed("s"): + box.yvelocity -= 1 # sets it yvelocity experiment with it and you find out its for movement + elif keyboard.is_pressed("q"): + exit() # exits the game + game.update() # makes an update for every object in the game + time.sleep(0.05) + +``` \ No newline at end of file