diff --git a/assets/Game.tiled-project b/assets/Game.tiled-project new file mode 100644 index 0000000..d0eb592 --- /dev/null +++ b/assets/Game.tiled-project @@ -0,0 +1,14 @@ +{ + "automappingRulesFile": "", + "commands": [ + ], + "compatibilityVersion": 1100, + "extensionsPath": "extensions", + "folders": [ + "." + ], + "properties": [ + ], + "propertyTypes": [ + ] +} diff --git a/assets/Game.tiled-session b/assets/Game.tiled-session new file mode 100644 index 0000000..a5353e4 --- /dev/null +++ b/assets/Game.tiled-session @@ -0,0 +1,41 @@ +{ + "activeFile": "tiles.tsx", + "expandedProjectPaths": [ + ".", + "levels" + ], + "fileStates": { + "levels/default.tmx": { + "scale": 0.6685185185185185, + "selectedLayer": 0, + "viewCenter": { + "x": 554.2105263157895, + "y": 487.6454293628809 + } + }, + "tiles.tsx": { + "dynamicWrapping": false, + "scaleInDock": 1, + "scaleInEditor": 1 + } + }, + "last.imagePath": "C:/Users/laktionov/Downloads/git/arcade/assets/pastel_resources_hex", + "map.lastUsedFormat": "tmx", + "map.layerDataFormat": "1", + "map.orientation": "4", + "map.renderOrder": "2", + "map.tileHeight": 64, + "map.tileWidth": 55, + "map.width": 20, + "openFiles": [ + "levels/default.tmx", + "tiles.tsx" + ], + "project": "Game.tiled-project", + "recentFiles": [ + "levels/default.tmx", + "tiles.tsx" + ], + "tileset.lastUsedFormat": "tsx", + "tileset.type": 1 +} diff --git a/assets/blank.png b/assets/blank.png new file mode 100644 index 0000000..9552015 Binary files /dev/null and b/assets/blank.png differ diff --git a/assets/levels/default.tmx b/assets/levels/default.tmx new file mode 100644 index 0000000..ac55009 --- /dev/null +++ b/assets/levels/default.tmx @@ -0,0 +1,11 @@ + + + + + +0,40, +55,55, +0,40 + + + diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000..c022618 Binary files /dev/null and b/assets/logo.png differ diff --git a/assets/pastel_resources_hex/clayHex.gif b/assets/pastel_resources_hex/clayHex.gif new file mode 100644 index 0000000..bd2c151 Binary files /dev/null and b/assets/pastel_resources_hex/clayHex.gif differ diff --git a/assets/pastel_resources_hex/desertHex.gif b/assets/pastel_resources_hex/desertHex.gif new file mode 100644 index 0000000..5fcc382 Binary files /dev/null and b/assets/pastel_resources_hex/desertHex.gif differ diff --git a/assets/pastel_resources_hex/miscPort0.gif b/assets/pastel_resources_hex/miscPort0.gif new file mode 100644 index 0000000..8ca5c69 Binary files /dev/null and b/assets/pastel_resources_hex/miscPort0.gif differ diff --git a/assets/pastel_resources_hex/miscPort1.gif b/assets/pastel_resources_hex/miscPort1.gif new file mode 100644 index 0000000..83bed92 Binary files /dev/null and b/assets/pastel_resources_hex/miscPort1.gif differ diff --git a/assets/pastel_resources_hex/miscPort2.gif b/assets/pastel_resources_hex/miscPort2.gif new file mode 100644 index 0000000..04d7877 Binary files /dev/null and b/assets/pastel_resources_hex/miscPort2.gif differ diff --git a/assets/pastel_resources_hex/miscPort3.gif b/assets/pastel_resources_hex/miscPort3.gif new file mode 100644 index 0000000..b84bc2c Binary files /dev/null and b/assets/pastel_resources_hex/miscPort3.gif differ diff --git a/assets/pastel_resources_hex/miscPort4.gif b/assets/pastel_resources_hex/miscPort4.gif new file mode 100644 index 0000000..74dd763 Binary files /dev/null and b/assets/pastel_resources_hex/miscPort4.gif differ diff --git a/assets/pastel_resources_hex/miscPort5.gif b/assets/pastel_resources_hex/miscPort5.gif new file mode 100644 index 0000000..6ed1e67 Binary files /dev/null and b/assets/pastel_resources_hex/miscPort5.gif differ diff --git a/assets/pastel_resources_hex/oreHex.gif b/assets/pastel_resources_hex/oreHex.gif new file mode 100644 index 0000000..5a5f0e4 Binary files /dev/null and b/assets/pastel_resources_hex/oreHex.gif differ diff --git a/assets/pastel_resources_hex/port0.gif b/assets/pastel_resources_hex/port0.gif new file mode 100644 index 0000000..2b4093f Binary files /dev/null and b/assets/pastel_resources_hex/port0.gif differ diff --git a/assets/pastel_resources_hex/port1.gif b/assets/pastel_resources_hex/port1.gif new file mode 100644 index 0000000..ed23f6b Binary files /dev/null and b/assets/pastel_resources_hex/port1.gif differ diff --git a/assets/pastel_resources_hex/port2.gif b/assets/pastel_resources_hex/port2.gif new file mode 100644 index 0000000..d7a8caf Binary files /dev/null and b/assets/pastel_resources_hex/port2.gif differ diff --git a/assets/pastel_resources_hex/port3.gif b/assets/pastel_resources_hex/port3.gif new file mode 100644 index 0000000..ec01f4e Binary files /dev/null and b/assets/pastel_resources_hex/port3.gif differ diff --git a/assets/pastel_resources_hex/port4.gif b/assets/pastel_resources_hex/port4.gif new file mode 100644 index 0000000..d735598 Binary files /dev/null and b/assets/pastel_resources_hex/port4.gif differ diff --git a/assets/pastel_resources_hex/port5.gif b/assets/pastel_resources_hex/port5.gif new file mode 100644 index 0000000..49c3299 Binary files /dev/null and b/assets/pastel_resources_hex/port5.gif differ diff --git a/assets/pastel_resources_hex/rotat/clayHex.gif b/assets/pastel_resources_hex/rotat/clayHex.gif new file mode 100644 index 0000000..9cadc69 Binary files /dev/null and b/assets/pastel_resources_hex/rotat/clayHex.gif differ diff --git a/assets/pastel_resources_hex/rotat/desertHex.gif b/assets/pastel_resources_hex/rotat/desertHex.gif new file mode 100644 index 0000000..6b71c25 Binary files /dev/null and b/assets/pastel_resources_hex/rotat/desertHex.gif differ diff --git a/assets/pastel_resources_hex/rotat/miscPort0.gif b/assets/pastel_resources_hex/rotat/miscPort0.gif new file mode 100644 index 0000000..afe6627 Binary files /dev/null and b/assets/pastel_resources_hex/rotat/miscPort0.gif differ diff --git a/assets/pastel_resources_hex/rotat/miscPort1.gif b/assets/pastel_resources_hex/rotat/miscPort1.gif new file mode 100644 index 0000000..5f7f09d Binary files /dev/null and b/assets/pastel_resources_hex/rotat/miscPort1.gif differ diff --git a/assets/pastel_resources_hex/rotat/miscPort2.gif b/assets/pastel_resources_hex/rotat/miscPort2.gif new file mode 100644 index 0000000..d317e4d Binary files /dev/null and b/assets/pastel_resources_hex/rotat/miscPort2.gif differ diff --git a/assets/pastel_resources_hex/rotat/miscPort3.gif b/assets/pastel_resources_hex/rotat/miscPort3.gif new file mode 100644 index 0000000..3b25ef4 Binary files /dev/null and b/assets/pastel_resources_hex/rotat/miscPort3.gif differ diff --git a/assets/pastel_resources_hex/rotat/miscPort4.gif b/assets/pastel_resources_hex/rotat/miscPort4.gif new file mode 100644 index 0000000..15e73df Binary files /dev/null and b/assets/pastel_resources_hex/rotat/miscPort4.gif differ diff --git a/assets/pastel_resources_hex/rotat/miscPort5.gif b/assets/pastel_resources_hex/rotat/miscPort5.gif new file mode 100644 index 0000000..966e770 Binary files /dev/null and b/assets/pastel_resources_hex/rotat/miscPort5.gif differ diff --git a/assets/pastel_resources_hex/rotat/oreHex.gif b/assets/pastel_resources_hex/rotat/oreHex.gif new file mode 100644 index 0000000..6b748f2 Binary files /dev/null and b/assets/pastel_resources_hex/rotat/oreHex.gif differ diff --git a/assets/pastel_resources_hex/rotat/port0.gif b/assets/pastel_resources_hex/rotat/port0.gif new file mode 100644 index 0000000..23368a4 Binary files /dev/null and b/assets/pastel_resources_hex/rotat/port0.gif differ diff --git a/assets/pastel_resources_hex/rotat/port1.gif b/assets/pastel_resources_hex/rotat/port1.gif new file mode 100644 index 0000000..9ff4d83 Binary files /dev/null and b/assets/pastel_resources_hex/rotat/port1.gif differ diff --git a/assets/pastel_resources_hex/rotat/port2.gif b/assets/pastel_resources_hex/rotat/port2.gif new file mode 100644 index 0000000..388300b Binary files /dev/null and b/assets/pastel_resources_hex/rotat/port2.gif differ diff --git a/assets/pastel_resources_hex/rotat/port3.gif b/assets/pastel_resources_hex/rotat/port3.gif new file mode 100644 index 0000000..35802b2 Binary files /dev/null and b/assets/pastel_resources_hex/rotat/port3.gif differ diff --git a/assets/pastel_resources_hex/rotat/port4.gif b/assets/pastel_resources_hex/rotat/port4.gif new file mode 100644 index 0000000..1323b2e Binary files /dev/null and b/assets/pastel_resources_hex/rotat/port4.gif differ diff --git a/assets/pastel_resources_hex/rotat/port5.gif b/assets/pastel_resources_hex/rotat/port5.gif new file mode 100644 index 0000000..4a06d69 Binary files /dev/null and b/assets/pastel_resources_hex/rotat/port5.gif differ diff --git a/assets/pastel_resources_hex/rotat/sheepHex.gif b/assets/pastel_resources_hex/rotat/sheepHex.gif new file mode 100644 index 0000000..8cd12f6 Binary files /dev/null and b/assets/pastel_resources_hex/rotat/sheepHex.gif differ diff --git a/assets/pastel_resources_hex/rotat/waterHex.gif b/assets/pastel_resources_hex/rotat/waterHex.gif new file mode 100644 index 0000000..ae80fb1 Binary files /dev/null and b/assets/pastel_resources_hex/rotat/waterHex.gif differ diff --git a/assets/pastel_resources_hex/rotat/wheatHex.gif b/assets/pastel_resources_hex/rotat/wheatHex.gif new file mode 100644 index 0000000..f9cf917 Binary files /dev/null and b/assets/pastel_resources_hex/rotat/wheatHex.gif differ diff --git a/assets/pastel_resources_hex/rotat/woodHex.gif b/assets/pastel_resources_hex/rotat/woodHex.gif new file mode 100644 index 0000000..112d7e0 Binary files /dev/null and b/assets/pastel_resources_hex/rotat/woodHex.gif differ diff --git a/assets/pastel_resources_hex/sheepHex.gif b/assets/pastel_resources_hex/sheepHex.gif new file mode 100644 index 0000000..a00715c Binary files /dev/null and b/assets/pastel_resources_hex/sheepHex.gif differ diff --git a/assets/pastel_resources_hex/waterHex.gif b/assets/pastel_resources_hex/waterHex.gif new file mode 100644 index 0000000..9bc7526 Binary files /dev/null and b/assets/pastel_resources_hex/waterHex.gif differ diff --git a/assets/pastel_resources_hex/wheatHex.gif b/assets/pastel_resources_hex/wheatHex.gif new file mode 100644 index 0000000..dadc1d3 Binary files /dev/null and b/assets/pastel_resources_hex/wheatHex.gif differ diff --git a/assets/pastel_resources_hex/woodHex.gif b/assets/pastel_resources_hex/woodHex.gif new file mode 100644 index 0000000..3a846c1 Binary files /dev/null and b/assets/pastel_resources_hex/woodHex.gif differ diff --git a/assets/pole.png b/assets/pole.png new file mode 100644 index 0000000..fc9e0f0 Binary files /dev/null and b/assets/pole.png differ diff --git a/assets/tiles.tsx b/assets/tiles.tsx new file mode 100644 index 0000000..da360e4 --- /dev/null +++ b/assets/tiles.tsx @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cards.json b/cards.json new file mode 100644 index 0000000..0cda026 --- /dev/null +++ b/cards.json @@ -0,0 +1,46 @@ +[ + { + "title":"Велопрокат", + "rent":20, + "h1":10, + "h2":30, + "h3":90, + "h4":10, + "mortage":30, + "iins":50, + "group":1 + }, + { + "title":"Пони-клуб", + "rent":20, + "h1":10, + "h2":30, + "h3":90, + "h4":10, + "mortage":30, + "iins":50, + "group":1 + }, + { + "title":"Пони-клуб", + "rent":20, + "h1":10, + "h2":30, + "h3":90, + "h4":10, + "mortage":30, + "iins":50, + "group":1 + }, + { + "title":"Пони-клуб", + "rent":20, + "h1":10, + "h2":30, + "h3":90, + "h4":10, + "mortage":30, + "iins":50, + "group":1 + } +] diff --git a/game.py b/game.py new file mode 100644 index 0000000..7e4d95d --- /dev/null +++ b/game.py @@ -0,0 +1,34 @@ +import arcade +import json + +cards = list() +screen = (1280,768) + +class Tile(arcade.Sprite): + ls = arcade.SpriteList() + def __init__(self,c): + super().__init__('./assets/blank.png', scale=1.0) + self.title = c['title'] + self.text = arcade.Text(self.title,screen[0]//2,screen[1]//2,(0,0,0)) + self.position = (screen[0]//2,screen[1]//2) + Tile.ls.append(self) + + +class MainView(arcade.View): + def __init__(self): + super().__init__() + #self.background = arcade.load_texture("./assets/pole.png") + with open('cards.json','r',encoding='utf-8') as f: + cards = json.loads(f.read()) + for c in cards: + Tile(c) + + def on_draw(self): + self.clear((100,100,200)) + Tile.ls.draw() + +if __name__ == '__main__': + window = arcade.Window(fullscreen=True) + screen = (window.width,window.height) + window.show_view(MainView()) + arcade.run() diff --git a/logo.py b/logo.py new file mode 100644 index 0000000..d4cf50a --- /dev/null +++ b/logo.py @@ -0,0 +1,26 @@ +import arcade +from menu import MainMenu + +class LogoView(arcade.View): + def __init__(self): + super().__init__() + self.screen = (self.window.width,self.window.height) + self.logo = arcade.Sprite('./assets/logo.png',scale=1.0) + self.logo.position = (self.screen[0]//2,self.screen[1]//2) + self.logo.alpha = 0 + self.logo.onshow = True + self.spl = arcade.SpriteList() + self.spl.append(self.logo) + + def on_update(self,delta_time): + if self.logo.onshow: + self.logo.alpha += 127*delta_time + if self.logo.alpha >= 255: + self.logo.onshow = False + else: + self.logo.alpha -= 127*delta_time + if self.logo.alpha <= 0: + self.window.show_view(MainMenu()) + def on_draw(self): + self.clear() + self.spl.draw() diff --git a/main.py b/main.py new file mode 100644 index 0000000..2c6ba4e --- /dev/null +++ b/main.py @@ -0,0 +1,7 @@ +import arcade +from logo import LogoView + +if __name__ == '__main__': + window = arcade.Window(fullscreen=True) + window.show_view(LogoView()) + arcade.run() diff --git a/menu.py b/menu.py new file mode 100644 index 0000000..3ace8b6 --- /dev/null +++ b/menu.py @@ -0,0 +1,55 @@ +import arcade +from arcade.gui import UIManager, UIAnchorLayout, UITextureButton, UIGridLayout +from game import MainView + +class MainMenu(arcade.View): + def __init__(self): + super().__init__() + + self.ui = UIManager() + grid = UIGridLayout( + column_count=1, + row_count=4, + size_hint=(0, 0), + vertical_spacing=10, + horizontal_spacing=10, + ) + anchor = self.ui.add(UIAnchorLayout(children=[grid])) + normal = arcade.load_texture(":resources:gui_basic_assets/button/red_normal.png") + hover = arcade.load_texture(":resources:gui_basic_assets/button/red_hover.png") + press = arcade.load_texture(":resources:gui_basic_assets/button/red_press.png") + + button_start = grid.add(UITextureButton( + text = "Start", + texture=normal, + texture_hovered=hover, + texture_pressed=press + ),row=0,column=0) + button_exit = grid.add(UITextureButton( + text = "Exit", + texture=normal, + texture_hovered=hover, + texture_pressed=press + ),row=1,column=0) + + @button_start.event('on_click') + def on_click(event): + self.window.show_view(MainView()) + + @button_exit.event('on_click') + def on_click(event): + self.window.close() + + def on_show_view(self): + self.ui.enable() + + def on_hide_view(self): + self.ui.disable() + + def on_draw(self): + self.clear((100,100,200)) + self.ui.draw() +if __name__ == '__main__': + window = arcade.Window(fullscreen=True) + window.show_view(MainMenu()) + arcade.run()