Compare commits
5 Commits
32666d4e2d
...
30a16baab3
Author | SHA1 | Date |
---|---|---|
GreenXenith | 30a16baab3 | |
GreenXenith | aec7662c0c | |
GreenXenith | d820dc08c5 | |
GreenXenith | 46c6393f58 | |
GreenXenith | c68eee3bee |
|
@ -0,0 +1,18 @@
|
|||
MIT Copyright 2021 GreenXenith
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
25
README.md
25
README.md
|
@ -1,10 +1,23 @@
|
|||
# Zoria
|
||||
An RPG Dungeon Crawler using PyGame
|
||||
Real-time 2.5D RPG Dungeon Crawler using PyGame
|
||||
|
||||
## Usage
|
||||
`python3 zoria.py`
|
||||
`python3 .`
|
||||
|
||||
## Notes
|
||||
* Features currently only include rendering, map generation, movement, and sprite animation
|
||||
* `setup.sh` is for git configuration across multiple machines (don't use it)
|
||||
* `map.json` is not in use. `generator.py` creates maps when loading
|
||||
## Controls
|
||||
| Key | Action |
|
||||
| ------- | --------- |
|
||||
| `WASD` | Movement |
|
||||
| `SPACE` | Attack |
|
||||
| `SHIFT` | Use stair |
|
||||
|
||||
## Premise
|
||||
Each level contains a key and a locked hatch. Collect the key in order to unlock the passage to the next level (`SHIFT` to unlock).
|
||||
Slimes do minimal damage, but more spawn on each level. They can drop health or XP. More XP = more damage dealt per hit. Coins are currently useless.
|
||||
The levels are infinite and persistent. The only limit is your RAM. World resets on death.
|
||||
|
||||
## Known Bugs
|
||||
* Window resizing is mostly broken on Linux. This is a bug in SDL2. Using the maximize button _should_ work most of the time.
|
||||
* Slimes get stuck in corners. Probably due to the raycaster hitting the corner at the start (rounding issue?).
|
||||
* Corpses may remove keys and doorways.
|
||||
* Walls occasionally render improperly. Usually occurs when two rooms are close to each other diagonally.
|
||||
|
|
21
setup.sh
21
setup.sh
|
@ -1,21 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
printf "Username: "
|
||||
read NAME
|
||||
|
||||
printf "Email: "
|
||||
read EMAIL
|
||||
|
||||
echo "Configuring git..."
|
||||
|
||||
git config user.name $NAME
|
||||
git config user.email $EMAIL
|
||||
|
||||
git config credential.username $NAME
|
||||
git config credential.email $EMAIL
|
||||
|
||||
echo "Installing pylint..."
|
||||
pip3 install pylint
|
||||
|
||||
echo "Installing pygame..."
|
||||
pip3 install pygame
|
|
@ -10,7 +10,7 @@ screen = pygame.display.set_mode(winsize, pygame.RESIZABLE)
|
|||
|
||||
# Load all assets
|
||||
from . import assets
|
||||
for filename in os.listdir(os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), "assets")):
|
||||
for filename in os.listdir(os.path.join(os.getcwd(), "assets")):
|
||||
assets.load(filename)
|
||||
|
||||
pygame.display.set_caption("Zoria")
|
||||
|
|
|
@ -152,6 +152,7 @@ class Player:
|
|||
slash.texture.set_animation(0, 3, 5)
|
||||
|
||||
# Check for enemies
|
||||
# This probably shouldnt be handled by the player but whatever
|
||||
if self.z < len(map.sprites):
|
||||
for sprite in map.sprites[self.z]:
|
||||
if sprite.name[:6] == "enemy:":
|
||||
|
@ -160,6 +161,7 @@ class Player:
|
|||
sprite.vel = (sprite.vel * -2) + self.vel + (self.look * 2) # Knockback
|
||||
if sprite.hp <= 0:
|
||||
setat = round(sprite.pos)
|
||||
# BUG: Corpses may remove keys and doorways
|
||||
map.set_tile(int(setat.x), int(setat.y), int(sprite.z), sprite.name + "_dead")
|
||||
map.remove_sprite(sprite.id)
|
||||
drop = rand.rand(0, 7)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
# random.randint wrapper
|
||||
import random
|
||||
import time
|
||||
|
||||
def rand(*args):
|
||||
random.seed(time.clock())
|
||||
random.seed()
|
||||
return random.randint(*args)
|
||||
|
|
Loading…
Reference in New Issue