This is kind of a Diablo-like game setup, i though it would be better to upload
this little demo now that still is simple and clean.
The program generates a random old style dungeon with rooms,corridors,doors,lights and stairs.
You can walk around with your avatar with an a-star pathfinding system.
A Permissive field of View Algorithm is implemented to determine visible, invisible and shadowed cells in the dungeon from the avatar perspective
You can change the Field of View behavior mode by pressing F4 (modes 0,1,2, default 2)
Each time you take a stair/elevator, a new random dungeon is generated.
Main classes
World: setup and initialization
Map: generates a random abstract map and prints an ascii representation
can be used alone without dependencies
Grid: initialites Map and generates the 3d grid from the map data
Avatar: generates the avatar and his behaviors
Cam: setup camera control
Support classes
Pathfinder: used for a* searchpaths
Fov: used for Permissive Field of View
Picker: used for mouse picks
functions.py: a collection of usefull functions for loading models,textures,etc…
Controls
Left Mouse: Walk to selected cell
Middle Mouse: Rotate camera around avatar
Mouse Wheel: Zoom camera in and out
F1: toggle wireframe
F2: toggle texture
F3: take snapshot
F4: change Fov Mode:
0:disabled
1:hide not visible tiles
2:hide not visited tiles and obscure visited
The program can be run only with python+panda3d, no other library dependencies exist.
About the media required, only a cube egg model and a few textures are needed at the moment,
and are included in the zip package.
Textures are defined in the grid.py class, if you wanna change them.
grab it here:
version 1
http://handeozerden.com/snaptothegrid/panda/minirogue/minirogue_v01.zip
version 2 (with FOV)
http://handeozerden.com/snaptothegrid/panda/minirogue/minirogue_v02.zip
GUI
http://handeozerden.com/snaptothegrid/panda/minirogue/gui_v01.zip
I thought it would be nice to show this as it is, separate from the game code, as an example of a simple 2d graphic user interface.
press f1 to toggle fullScreen on/off, space to insert a new message in the console, letter ‘c’ toggles the console mode simple/extended
question: Anybody could illustrate me on how to make one of the sprites created on this application pickable?
note: by the way, i started on this by modifing the script on this thread https://discourse.panda3d.org/viewtopic.php?t=6624, thanks!
i’ll try to keep posting future versions here.
help tips and comments will be appreciated
c