A small library for creating objects, game sims, and physics in python, more things coming soon
Project description
GoofPy
A library for creating objects and game sims in Python, more things coming soon
Currently supports:
- Pygame
- GameObjects
- Players
- Games
Current limitations:
- 3D objects are somewhat limited and may be broken, movement on the z-axis, especially for the
Player
class is not fully supported - Pygame window is buggy, runs at 1x1 scale by default, but even when changed, is impossible to close using the "X" in the top right or
Alt + F4
- No renders, and no built-in rendering capabilities planned, however, Pygame support would help users make renders
Docs:
-
goof
class: Takes ID(int) and meta(any)import goofpy obj = goofpy.goof(0, "TestMeta")
Class functions:
getID()
,getMeta()
, andsetMeta(value)
, are properties of anygoof
class, self-explanatory The below are not part of thegoof
class but relate to it.getObjectByClass(class)
returns all instances of a certain classgetMetaById(id)
is self-explanatorycompareMeta(originalID, newID)
gets the meta of the object based on id, returnsTrue
if the 2 are equalgetObjsWithMeta(meta)
returns all objects with a particular meta value
-
GameObject
class: Takes an ID, x, y, z, data, type, can take zIndex(default is 0)import goofpy obj = goofpy.goof(0, "TestMeta") gObj = goofpy.GameObject(obj.goofid,
Class functions: There are class functions, but most are either self-explanatory or are useless to the user, because there are much simpler ways with the
Creator
class -
Creator
class: Takes no parametersimport goofpy c = goofpy.Creator()
Class functions:
givePosition2D(obj: goof, x, y, zIndex)
takes these variables and creates a GameObject with them, with a set z of 0.0, a data of "", and a type of "2D"givePosition3D(obj: goof, x, y, z)
same asgivePosition2D
but gives a z ofz
and a type of "3D", and doesn't change zIndexnew2D(x, y, zIndex, data)
same asgivePosition2D
but passes in data and doesn't pass in an objectnew3D(x, y, z, data)
same asnew2D
but passes in a float of z and not zIndex
-
Player
class: Takes a x, y, z, facing, and fovimport goofpy p = goofpy.Player(0.0, 0.0, 0.0, 0, 90)
Class functions:
isColliding(obj)
tests if the player is colliding with an objectcanSee(obj)
tests ifobj
is being faced at by the player,
uses THE BEST FUNCTION IN ALL OF PYTHON, math.atan2(y, x)
move(d)
movesd
units in the direction the player is facingturn(deg)
turns the playerdeg
degrees(positve or negative, loops from 0-360, cannot be > 360)
-
Game
class Optionally takes width and height, if you want an actual window/render, and the module for the engine, default and ONLY CURRENTLY SUPPORTED engine is pygameimport goofpy g = goofpy.Game()
Class functions:
initEngine()
starts the engine, required for using otherGame
class functionskeyPressed(key)
tests if the key namedkey
runAtFPS(fps)
ticks the game atfps
frames per secondgetEvents()
returns all events from the last tickrun(gameFunction, fps)
runs the game, usinggameFunction()
as the code and setup for the game, and running it atfps
frames per second, easier alternitve to custom setup, but more limited and standard
Support:
- Email
business.endergames@gmail.com
for additional help or feedback
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file goofpy-0.2.2.tar.gz
.
File metadata
- Download URL: goofpy-0.2.2.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1b5c29dd25d595d3cbe7c82030afc6d9cf58d6ffcdbaf85edb1bb3b6755080a |
|
MD5 | 55f928cd9107cf65671ed7aab32ff7cb |
|
BLAKE2b-256 | 6062f3a2ba4e6ab89d17a6f0444b6e479f90393070955c1db9b2c50587e1ec31 |
File details
Details for the file goofpy-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: goofpy-0.2.2-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0bc528a700f49654a8e7299ac84953bbe4ea6d4beaa98049a1162a9921b62d9 |
|
MD5 | a47a4b3e98a278d8d04455fb348a465f |
|
BLAKE2b-256 | 58b55e219c71d5205befa37e3f436b0ee93b261cf4f16ecd78ac1c83f2db6d22 |