Fix packaging and switch to saner default speed
This commit is contained in:
parent
38e96e9102
commit
b17d3d4337
4
setup.py
4
setup.py
|
@ -7,7 +7,7 @@ with open('README.rst') as f:
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='slacker-game',
|
name='slacker-game',
|
||||||
version='2.0.1',
|
version='2.0.2',
|
||||||
description='A clone of the arcade game Stacker',
|
description='A clone of the arcade game Stacker',
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
url='https://github.com/McSinyx/slacker-game',
|
url='https://github.com/McSinyx/slacker-game',
|
||||||
|
@ -29,5 +29,5 @@ setup(
|
||||||
keywords='stacker arcade-game pygame-application',
|
keywords='stacker arcade-game pygame-application',
|
||||||
packages=['slacker_game'],
|
packages=['slacker_game'],
|
||||||
install_requires=['pygame'],
|
install_requires=['pygame'],
|
||||||
package_data={'slacker_game': ['VT323-Regular.ttf']},
|
package_data={'slacker_game': ['VT323-Regular.ttf', 'icon.png']},
|
||||||
entry_points={'gui_scripts': ['slacker-game = slacker_game:main']})
|
entry_points={'gui_scripts': ['slacker-game = slacker_game:main']})
|
||||||
|
|
|
@ -86,7 +86,7 @@ class SlackerTile:
|
||||||
(self.y+self.get_yoffset()) * self.SIZE,
|
(self.y+self.get_yoffset()) * self.SIZE,
|
||||||
self.SIZE, self.SIZE)
|
self.SIZE, self.SIZE)
|
||||||
pygame.draw.rect(self.screen, color, rect)
|
pygame.draw.rect(self.screen, color, rect)
|
||||||
pygame.draw.rect(self.screen, self.BG, rect, self.SIZE / 11)
|
pygame.draw.rect(self.screen, self.BG, rect, self.SIZE // 11)
|
||||||
|
|
||||||
|
|
||||||
class Slacker:
|
class Slacker:
|
||||||
|
@ -103,6 +103,9 @@ class Slacker:
|
||||||
ICON = pygame.image.load(data('icon.png'))
|
ICON = pygame.image.load(data('icon.png'))
|
||||||
|
|
||||||
MAX_WIDTH = (1,)*7 + (2,)*5 + (3,)*3
|
MAX_WIDTH = (1,)*7 + (2,)*5 + (3,)*3
|
||||||
|
MAX_SPEED = 70
|
||||||
|
SPEED_DIFF = 5
|
||||||
|
INIT_SPEED = MAX_SPEED + (BOARD_HEIGHT + 1)*SPEED_DIFF
|
||||||
COLOR_CHANGE_Y = 5 # blocks below which are displayed in the alternate color
|
COLOR_CHANGE_Y = 5 # blocks below which are displayed in the alternate color
|
||||||
WIN_LEVEL = 15
|
WIN_LEVEL = 15
|
||||||
WIN_SPEED = 100
|
WIN_SPEED = 100
|
||||||
|
@ -116,7 +119,7 @@ class Slacker:
|
||||||
self.game_state = self.PLAYING if restart else self.INTRO
|
self.game_state = self.PLAYING if restart else self.INTRO
|
||||||
self.falling_tiles = []
|
self.falling_tiles = []
|
||||||
self.screen = pygame.display.set_mode(self.SCREEN_SIZE)
|
self.screen = pygame.display.set_mode(self.SCREEN_SIZE)
|
||||||
self.speed = 84 + randrange(5)
|
self.speed = self.INIT_SPEED + randrange(5)
|
||||||
self.speed_ratio = 1.0
|
self.speed_ratio = 1.0
|
||||||
self.width = self.MAX_WIDTH[-1]
|
self.width = self.MAX_WIDTH[-1]
|
||||||
self.y = self.BOARD_HEIGHT - 1
|
self.y = self.BOARD_HEIGHT - 1
|
||||||
|
@ -194,7 +197,7 @@ class Slacker:
|
||||||
else:
|
else:
|
||||||
self.y -= 1
|
self.y -= 1
|
||||||
self.width = min(self.width, self.MAX_WIDTH[self.y])
|
self.width = min(self.width, self.MAX_WIDTH[self.y])
|
||||||
self.speed = 42 + self.y*3 + randrange(5)
|
self.speed = self.MAX_SPEED + self.y*self.SPEED_DIFF + randrange(5)
|
||||||
|
|
||||||
def main_loop(self, loop=True):
|
def main_loop(self, loop=True):
|
||||||
"""The main loop."""
|
"""The main loop."""
|
||||||
|
|
Loading…
Reference in New Issue