Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f2e476f01f |
@@ -1,37 +0,0 @@
|
||||
{
|
||||
"Map/SizeTest": {
|
||||
"height": 4300,
|
||||
"width": 2
|
||||
},
|
||||
"activeFile": "assets/level1.tmx",
|
||||
"expandedProjectPaths": [
|
||||
],
|
||||
"fileStates": {
|
||||
"assets/level1.tmx": {
|
||||
"scale": 0.95296875,
|
||||
"selectedLayer": 0,
|
||||
"viewCenter": {
|
||||
"x": 480.07870142646334,
|
||||
"y": 320.05246761764226
|
||||
}
|
||||
},
|
||||
"assets/tiles/terrain_atlas.tsx": {
|
||||
"scaleInDock": 1,
|
||||
"scaleInEditor": 1
|
||||
}
|
||||
},
|
||||
"last.imagePath": "C:/Users/User/Downloads/git/arcade/assets/tiles",
|
||||
"map.lastUsedFormat": "tmx",
|
||||
"map.layerDataFormat": null,
|
||||
"map.renderOrder": null,
|
||||
"openFiles": [
|
||||
"assets/level1.tmx",
|
||||
"assets/tiles/terrain_atlas.tsx"
|
||||
],
|
||||
"project": "Game.tiled-project",
|
||||
"recentFiles": [
|
||||
"assets/tiles/terrain_atlas.tsx",
|
||||
"assets/level1.tmx"
|
||||
],
|
||||
"tileset.lastUsedFormat": "tsx"
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="left-down" width="30" height="20" tilewidth="32" tileheight="32" infinite="0" nextlayerid="3" nextobjectid="1">
|
||||
<tileset firstgid="1" source="tiles/terrain_atlas.tsx"/>
|
||||
<layer id="2" name="flor" width="30" height="20">
|
||||
<data encoding="base64">
|
||||
ygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMsCAACKAgAAyQIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAAygIAAMoCAADKAgAA
|
||||
</data>
|
||||
</layer>
|
||||
</map>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<map version="1.10" tiledversion="1.12.1" orientation="hexagonal" renderorder="left-down" width="2" height="3" tilewidth="55" tileheight="64" infinite="0" hexsidelength="32" staggeraxis="y" staggerindex="odd" nextlayerid="2" nextobjectid="1">
|
||||
<tileset firstgid="1" source="../tiles.tsx"/>
|
||||
<layer id="1" name="Ground" width="2" height="3">
|
||||
<data encoding="csv">
|
||||
0,40,
|
||||
55,55,
|
||||
0,40
|
||||
</data>
|
||||
</layer>
|
||||
</map>
|
||||
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 1.2 MiB |
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<tileset version="1.10" tiledversion="1.12.1" name="Tiles" tilewidth="55" tileheight="64" tilecount="19" columns="0">
|
||||
<grid orientation="orthogonal" width="1" height="1"/>
|
||||
<tile id="38">
|
||||
<image source="pastel_resources_hex/clayHex.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="39">
|
||||
<image source="pastel_resources_hex/desertHex.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="40">
|
||||
<image source="pastel_resources_hex/miscPort0.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="41">
|
||||
<image source="pastel_resources_hex/miscPort1.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="42">
|
||||
<image source="pastel_resources_hex/miscPort2.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="43">
|
||||
<image source="pastel_resources_hex/miscPort3.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="44">
|
||||
<image source="pastel_resources_hex/miscPort4.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="45">
|
||||
<image source="pastel_resources_hex/miscPort5.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="46">
|
||||
<image source="pastel_resources_hex/oreHex.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="47">
|
||||
<image source="pastel_resources_hex/port0.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="48">
|
||||
<image source="pastel_resources_hex/port1.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="49">
|
||||
<image source="pastel_resources_hex/port2.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="50">
|
||||
<image source="pastel_resources_hex/port3.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="51">
|
||||
<image source="pastel_resources_hex/port4.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="52">
|
||||
<image source="pastel_resources_hex/port5.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="53">
|
||||
<image source="pastel_resources_hex/sheepHex.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="54">
|
||||
<image source="pastel_resources_hex/waterHex.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="55">
|
||||
<image source="pastel_resources_hex/wheatHex.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
<tile id="56">
|
||||
<image source="pastel_resources_hex/woodHex.gif" width="55" height="64"/>
|
||||
</tile>
|
||||
</tileset>
|
||||
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 211 KiB |
|
Before Width: | Height: | Size: 328 KiB |
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<tileset version="1.10" tiledversion="1.10.2" name="terrain_atlas" tilewidth="32" tileheight="32" tilecount="1024" columns="32">
|
||||
<image source="terrain_atlas.png" width="1024" height="1024"/>
|
||||
</tileset>
|
||||
@@ -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
|
||||
}
|
||||
]
|
||||
@@ -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()
|
||||
@@ -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()
|
||||
@@ -1,83 +1,7 @@
|
||||
import arcade
|
||||
|
||||
SCREEN_WIDTH = 800
|
||||
SCREEN_HEIGHT = 600
|
||||
|
||||
class Player(arcade.Sprite):
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
':resources:/images/animated_characters/female_adventurer/femaleAdventurer_idle.png',
|
||||
scale = 1
|
||||
)
|
||||
self.center_x = SCREEN_WIDTH//2
|
||||
self.center_y = SCREEN_HEIGHT//2
|
||||
#self.texture_left = arcade.SpriteSheet('./tiles/gold.png').get_texture_grid((64,64),4,4)
|
||||
|
||||
class Object(arcade.Sprite):
|
||||
def __init__(self,x,y):
|
||||
super().__init__()
|
||||
self.textures = arcade.SpriteSheet('./assets/tiles/BODY_animation.png').get_texture_grid((64,64),8,8)
|
||||
self.center_x = x
|
||||
self.center_y = y
|
||||
self.cur_texture = 0
|
||||
self.set_texture(self.cur_texture)
|
||||
self.timer = 0
|
||||
|
||||
def update(self,delta_time):
|
||||
self.timer += delta_time
|
||||
if self.timer >= 0.5:
|
||||
if self.cur_texture >= len(self.textures)-1:
|
||||
self.cur_texture = 0
|
||||
else:
|
||||
self.cur_texture += 1
|
||||
self.timer = 0
|
||||
self.set_texture(self.cur_texture)
|
||||
|
||||
|
||||
|
||||
class MainView(arcade.View):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.background_color = (100,100,200)
|
||||
self.player = Player()
|
||||
self.sprite_list = arcade.SpriteList()
|
||||
self.sprite_list.append(self.player)
|
||||
self.sprite_list.append(Object(100,50))
|
||||
|
||||
self.tilemap = arcade.load_tilemap('./assets/level1.tmx', scaling=1)
|
||||
self.flor_list = self.tilemap.sprite_lists["flor"]
|
||||
|
||||
def on_update(self,delta_time):
|
||||
self.sprite_list.update()
|
||||
|
||||
def on_draw(self):
|
||||
self.clear()
|
||||
self.flor_list.draw()
|
||||
arcade.draw_circle_filled(400,300,100,(255,255,0))
|
||||
arcade.draw_circle_filled(350,330,20,(0,0,0))
|
||||
arcade.draw_arc_outline(400,280,150,100,(0,0,0),200,340,10)
|
||||
self.sprite_list.draw()
|
||||
arcade.draw_circle_filled(450,330,20,(0,0,0))
|
||||
|
||||
def on_key_press(self,key,mod):
|
||||
if key == arcade.key.A:
|
||||
self.player.change_x = -5
|
||||
elif key == arcade.key.D:
|
||||
self.player.change_x = 5
|
||||
elif key == arcade.key.W:
|
||||
self.player.change_y = 5
|
||||
elif key == arcade.key.S:
|
||||
self.player.change_y = -5
|
||||
|
||||
def on_key_release(self,key,mod):
|
||||
if key == arcade.key.A or key == arcade.key.D:
|
||||
self.player.change_x = 0
|
||||
if key == arcade.key.W or key == arcade.key.S:
|
||||
self.player.change_y = 0
|
||||
|
||||
from logo import LogoView
|
||||
|
||||
if __name__ == '__main__':
|
||||
window = arcade.Window(SCREEN_WIDTH,SCREEN_HEIGHT,'Игра с видом сверху')
|
||||
view = MainView()
|
||||
window.show_view(view)
|
||||
arcade.run()
|
||||
window = arcade.Window(fullscreen=True)
|
||||
window.show_view(LogoView())
|
||||
arcade.run()
|
||||
|
||||
@@ -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()
|
||||