A small library for creating objects, game sims, and physics in python, more things coming soon
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
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
Playerclass 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:
-
goofclass: Takes ID(int) and meta(any)import goofpy obj = goofpy.goof(0, "TestMeta")Class functions:
getID(),getMeta(), andsetMeta(value), are properties of anygoofclass, self-explanatory The below are not part of thegoofclass 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, returnsTrueif the 2 are equalgetObjsWithMeta(meta)returns all objects with a particular meta value
-
GameObjectclass: 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
Creatorclass -
Creatorclass: 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 asgivePosition2Dbut gives a z ofzand a type of "3D", and doesn't change zIndexnew2D(x, y, zIndex, data)same asgivePosition2Dbut passes in data and doesn't pass in an objectnew3D(x, y, z, data)same asnew2Dbut passes in a float of z and not zIndex
-
Playerclass: 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 ifobjis being faced at by the player,
uses THE BEST FUNCTION IN ALL OF PYTHON, math.atan2(y, x)
move(d)movesdunits in the direction the player is facingturn(deg)turns the playerdegdegrees(positve or negative, loops from 0-360, cannot be > 360)
-
Gameclass 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 otherGameclass functionskeyPressed(key)tests if the key namedkeyrunAtFPS(fps)ticks the game atfpsframes 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 atfpsframes per second, easier alternitve to custom setup, but more limited and standard
Support:
- Email
business.endergames@gmail.comfor 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file goofpy-0.2.3.tar.gz.
File metadata
- Download URL: goofpy-0.2.3.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 |
da739dbbf4560eb54f86105b8a209b2288cde547e055073ef7d844e152c30d71
|
|
| MD5 |
1383ca04791757987bf3b9374d46f749
|
|
| BLAKE2b-256 |
9c22a7c152100857286eabb783f9c9137b1439d158ac0820fdf69d75535e7ae9
|
File details
Details for the file goofpy-0.2.3-py3-none-any.whl.
File metadata
- Download URL: goofpy-0.2.3-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 |
39db20f3464066ef51d78f33ea4ae47c2c2754251db5fabe7713d21f6692bdef
|
|
| MD5 |
3c1b1d983a825c4ce1c7886b68d2d6e5
|
|
| BLAKE2b-256 |
11ddce07d6ca4716a6c94643d16c281a0b20a21553fdf1fb3ea76a7ccdf0b249
|