Rename dungeonbattle to squirrelbattle
This commit is contained in:
parent
9232f67dc9
commit
d0ee9ec562
@ -1,9 +1,9 @@
|
||||
[![pipeline status](https://gitlab.crans.org/ynerant/dungeon-battle/badges/master/pipeline.svg)](https://gitlab.crans.org/ynerant/dungeon-battle/-/commits/master)
|
||||
[![coverage report](https://gitlab.crans.org/ynerant/dungeon-battle/badges/master/coverage.svg)](https://gitlab.crans.org/ynerant/dungeon-battle/-/commits/master)
|
||||
|
||||
# Dungeon Battle
|
||||
# Squirrel Battle
|
||||
|
||||
Projet de génie logiciel de M1
|
||||
Attention aux couteaux des écureuils !
|
||||
|
||||
## Création d'un environnement de développement
|
||||
|
||||
|
2
main.py
2
main.py
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
from dungeonbattle.bootstrap import Bootstrap
|
||||
from squirrelbattle.bootstrap import Bootstrap
|
||||
|
||||
if __name__ == "__main__":
|
||||
Bootstrap.run_game()
|
||||
|
@ -1,6 +1,6 @@
|
||||
from dungeonbattle.game import Game
|
||||
from dungeonbattle.display.display_manager import DisplayManager
|
||||
from dungeonbattle.term_manager import TermManager
|
||||
from squirrelbattle.game import Game
|
||||
from squirrelbattle.display.display_manager import DisplayManager
|
||||
from squirrelbattle.term_manager import TermManager
|
||||
|
||||
|
||||
class Bootstrap:
|
@ -1,8 +1,8 @@
|
||||
import curses
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
from dungeonbattle.display.texturepack import TexturePack
|
||||
from dungeonbattle.tests.screen import FakePad
|
||||
from squirrelbattle.display.texturepack import TexturePack
|
||||
from squirrelbattle.tests.screen import FakePad
|
||||
|
||||
|
||||
class Display:
|
@ -1,12 +1,12 @@
|
||||
import curses
|
||||
from dungeonbattle.display.mapdisplay import MapDisplay
|
||||
from dungeonbattle.display.statsdisplay import StatsDisplay
|
||||
from dungeonbattle.display.menudisplay import SettingsMenuDisplay, \
|
||||
from squirrelbattle.display.mapdisplay import MapDisplay
|
||||
from squirrelbattle.display.statsdisplay import StatsDisplay
|
||||
from squirrelbattle.display.menudisplay import SettingsMenuDisplay, \
|
||||
MainMenuDisplay
|
||||
from dungeonbattle.display.texturepack import TexturePack
|
||||
from squirrelbattle.display.texturepack import TexturePack
|
||||
from typing import Any
|
||||
from dungeonbattle.game import Game, GameMode
|
||||
from dungeonbattle.enums import DisplayActions
|
||||
from squirrelbattle.game import Game, GameMode
|
||||
from squirrelbattle.enums import DisplayActions
|
||||
|
||||
|
||||
class DisplayManager:
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
from dungeonbattle.interfaces import Map
|
||||
from squirrelbattle.interfaces import Map
|
||||
from .display import Display
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
from typing import List
|
||||
|
||||
from dungeonbattle.menus import Menu, MainMenu
|
||||
from squirrelbattle.menus import Menu, MainMenu
|
||||
from .display import Display
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ class MainMenuDisplay(Display):
|
||||
super().__init__(*args)
|
||||
self.menu = menu
|
||||
|
||||
with open("resources/ascii_art.txt", "r") as file:
|
||||
with open("squirrelbattle/assets/ascii_art.txt", "r") as file:
|
||||
self.title = file.read().split("\n")
|
||||
|
||||
self.pad = self.newpad(max(self.rows, len(self.title) + 30),
|
@ -2,7 +2,7 @@ import curses
|
||||
|
||||
from .display import Display
|
||||
|
||||
from dungeonbattle.entities.player import Player
|
||||
from squirrelbattle.entities.player import Player
|
||||
|
||||
|
||||
class StatsDisplay(Display):
|
@ -1,7 +1,7 @@
|
||||
from enum import Enum, auto
|
||||
from typing import Optional
|
||||
|
||||
from dungeonbattle.settings import Settings
|
||||
from squirrelbattle.settings import Settings
|
||||
|
||||
# This file contains a few useful enumeration classes used elsewhere in the code
|
||||
|
@ -38,7 +38,7 @@ class Game:
|
||||
Create a new game on the screen.
|
||||
"""
|
||||
# TODO generate a new map procedurally
|
||||
self.map = Map.load("resources/example_map_2.txt")
|
||||
self.map = Map.load("squirrelbattle/assets/example_map_2.txt")
|
||||
self.player = Player()
|
||||
self.map.add_entity(self.player)
|
||||
self.player.move(self.map.start_y, self.map.start_x)
|
@ -4,7 +4,7 @@ from math import sqrt
|
||||
from random import choice, randint
|
||||
from typing import List, Optional
|
||||
|
||||
from dungeonbattle.display.texturepack import TexturePack
|
||||
from squirrelbattle.display.texturepack import TexturePack
|
||||
|
||||
|
||||
class Map:
|
||||
@ -287,7 +287,7 @@ class Entity:
|
||||
"""
|
||||
Is this entity an item?
|
||||
"""
|
||||
from dungeonbattle.entities.items import Item
|
||||
from squirrelbattle.entities.items import Item
|
||||
return isinstance(self, Item)
|
||||
|
||||
@staticmethod
|
||||
@ -295,8 +295,8 @@ class Entity:
|
||||
"""
|
||||
Returns all entities subclasses
|
||||
"""
|
||||
from dungeonbattle.entities.items import Heart, Bomb
|
||||
from dungeonbattle.entities.monsters import Beaver, Hedgehog, \
|
||||
from squirrelbattle.entities.items import Heart, Bomb
|
||||
from squirrelbattle.entities.monsters import Beaver, Hedgehog, \
|
||||
Rabbit, TeddyBear
|
||||
return [Beaver, Bomb, Heart, Hedgehog, Rabbit, TeddyBear]
|
||||
|
||||
@ -305,10 +305,10 @@ class Entity:
|
||||
"""
|
||||
Returns all entities subclasses in a dictionary
|
||||
"""
|
||||
from dungeonbattle.entities.player import Player
|
||||
from dungeonbattle.entities.monsters import Beaver, Hedgehog, Rabbit, \
|
||||
from squirrelbattle.entities.player import Player
|
||||
from squirrelbattle.entities.monsters import Beaver, Hedgehog, Rabbit, \
|
||||
TeddyBear
|
||||
from dungeonbattle.entities.items import Bomb, Heart
|
||||
from squirrelbattle.entities.items import Bomb, Heart
|
||||
return {
|
||||
"Beaver": Beaver,
|
||||
"Bomb": Bomb,
|
@ -1,9 +1,9 @@
|
||||
import unittest
|
||||
|
||||
from dungeonbattle.entities.items import Bomb, Heart, Item
|
||||
from dungeonbattle.entities.monsters import Beaver, Hedgehog, Rabbit, TeddyBear
|
||||
from dungeonbattle.entities.player import Player
|
||||
from dungeonbattle.interfaces import Entity, Map
|
||||
from squirrelbattle.entities.items import Bomb, Heart, Item
|
||||
from squirrelbattle.entities.monsters import Beaver, Hedgehog, Rabbit, TeddyBear
|
||||
from squirrelbattle.entities.player import Player
|
||||
from squirrelbattle.interfaces import Entity, Map
|
||||
|
||||
|
||||
class TestEntities(unittest.TestCase):
|
||||
@ -11,7 +11,7 @@ class TestEntities(unittest.TestCase):
|
||||
"""
|
||||
Load example map that can be used in tests.
|
||||
"""
|
||||
self.map = Map.load("resources/example_map.txt")
|
||||
self.map = Map.load("squirrelbattle/assets/example_map.txt")
|
||||
self.player = Player()
|
||||
self.map.add_entity(self.player)
|
||||
self.player.move(self.map.start_y, self.map.start_x)
|
@ -1,13 +1,13 @@
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from dungeonbattle.bootstrap import Bootstrap
|
||||
from dungeonbattle.display.display import Display
|
||||
from dungeonbattle.display.display_manager import DisplayManager
|
||||
from dungeonbattle.entities.player import Player
|
||||
from dungeonbattle.game import Game, KeyValues, GameMode
|
||||
from dungeonbattle.menus import MainMenuValues
|
||||
from dungeonbattle.settings import Settings
|
||||
from squirrelbattle.bootstrap import Bootstrap
|
||||
from squirrelbattle.display.display import Display
|
||||
from squirrelbattle.display.display_manager import DisplayManager
|
||||
from squirrelbattle.entities.player import Player
|
||||
from squirrelbattle.game import Game, KeyValues, GameMode
|
||||
from squirrelbattle.menus import MainMenuValues
|
||||
from squirrelbattle.settings import Settings
|
||||
|
||||
|
||||
class TestGame(unittest.TestCase):
|
@ -1,7 +1,7 @@
|
||||
import unittest
|
||||
|
||||
from dungeonbattle.display.texturepack import TexturePack
|
||||
from dungeonbattle.interfaces import Map, Tile
|
||||
from squirrelbattle.display.texturepack import TexturePack
|
||||
from squirrelbattle.interfaces import Map, Tile
|
||||
|
||||
|
||||
class TestInterfaces(unittest.TestCase):
|
||||
@ -18,7 +18,7 @@ class TestInterfaces(unittest.TestCase):
|
||||
"""
|
||||
Try to load a map from a file.
|
||||
"""
|
||||
m = Map.load("resources/example_map.txt")
|
||||
m = Map.load("squirrelbattle/assets/example_map.txt")
|
||||
self.assertEqual(m.width, 52)
|
||||
self.assertEqual(m.height, 17)
|
||||
|
@ -1,6 +1,6 @@
|
||||
import unittest
|
||||
|
||||
from dungeonbattle.settings import Settings
|
||||
from squirrelbattle.settings import Settings
|
||||
|
||||
|
||||
class TestSettings(unittest.TestCase):
|
Loading…
Reference in New Issue
Block a user