squares
|
@ -3,3 +3,4 @@ local/
|
|||
MANIFEST
|
||||
dist/
|
||||
build/
|
||||
*.mp4
|
||||
|
|
146
NS.py
|
@ -52,11 +52,11 @@ class NS(Game, Animation):
|
|||
ds = self.get_display_surface()
|
||||
self.background = Surface(ds.get_size())
|
||||
self.background.fill((0, 0, 0))
|
||||
self.platform = Platform(self)
|
||||
self.title = Title(self)
|
||||
self.introduction = Introduction(self)
|
||||
self.ending = Ending(self)
|
||||
self.wipe = Wipe(self)
|
||||
self.platform = Platform(self)
|
||||
self.dialogue = Dialogue(self)
|
||||
self.chemtrails = Chemtrails(self)
|
||||
self.boss = Boss(self)
|
||||
|
@ -176,6 +176,52 @@ class NS(Game, Animation):
|
|||
self.reset()
|
||||
|
||||
|
||||
class Button(Sprite):
|
||||
|
||||
MARGIN = 2
|
||||
BLANK = (200, 200, 200)
|
||||
|
||||
def __init__(self, parent, edge, size, border):
|
||||
Sprite.__init__(self, parent)
|
||||
colors = self.get_game().platform.get_color_pair_from_edge(edge)
|
||||
width = size * 2 + self.MARGIN + border * 4
|
||||
step = width / 2 + self.MARGIN / 2
|
||||
rect_width = width / 2 - self.MARGIN / 2
|
||||
rects = Rect(0, 0, rect_width, rect_width), \
|
||||
Rect(step, 0, rect_width, rect_width), \
|
||||
Rect(step, step, rect_width, rect_width), \
|
||||
Rect(0, step, rect_width, rect_width)
|
||||
if edge == NS.N:
|
||||
colored = rects[0], rects[1]
|
||||
elif edge == NS.NE:
|
||||
colored = rects[1], rects[3]
|
||||
elif edge == NS.E:
|
||||
colored = rects[1], rects[2]
|
||||
elif edge == NS.NW:
|
||||
colored = rects[0], rects[2]
|
||||
elif edge == NS.S:
|
||||
colored = rects[3], rects[2]
|
||||
elif edge == NS.W:
|
||||
colored = rects[0], rects[3]
|
||||
for lightness in xrange(30, 90, 5):
|
||||
frame = Surface((width, width), SRCALPHA)
|
||||
for topleft in (0, 0), (step, 0), (step, step), (0, step):
|
||||
rect = Rect(topleft, (rect_width, rect_width))
|
||||
border_color = Color(*self.BLANK)
|
||||
border_color.a = 179
|
||||
frame.fill(border_color, rect)
|
||||
frame.fill((0, 0, 0, 0), rect.inflate(-border * 2, -border * 2))
|
||||
for ii in xrange(2):
|
||||
original_color = Color(*colors[ii])
|
||||
original_color.a = 255
|
||||
edited_color = Color(0, 0, 0)
|
||||
edited_color.hsla = int(original_color.hsla[0]), int(original_color.hsla[1]), \
|
||||
lightness, 70
|
||||
frame.fill(edited_color, colored[ii])
|
||||
frame.fill(original_color, colored[ii].inflate(-border * 2, -border * 2))
|
||||
self.add_frame(frame)
|
||||
|
||||
|
||||
class Title(GameChild):
|
||||
|
||||
def __init__(self, parent):
|
||||
|
@ -194,18 +240,19 @@ class Title(GameChild):
|
|||
self.border.location.center = dsr.centerx, dsr.bottom - 100
|
||||
self.text = Sprite(self)
|
||||
self.text.load_from_path(self.get_resource("Title_text.png"), True, False, (255, 0, 0))
|
||||
self.text.load_from_path(self.get_resource("Title_text_half.png"), True, False, (255, 0, 0))
|
||||
self.text.add_frameset([0], name="full", switch=True)
|
||||
self.text.add_frameset([1], name="half")
|
||||
self.text.location.center = dsr.centerx, dsr.bottom - 100
|
||||
self.angle = choice((pi / 4, 3 * pi / 4, 5 * pi / 4, 7 * pi / 4))
|
||||
self.button_sound = self.get_game().sfx["button"]
|
||||
self.buttons = Button(self, NS.N, 10, 4), Button(self, NS.NW, 10, 4)
|
||||
self.buttons[0].location.center = 277, 381
|
||||
self.buttons[1].location.center = 453, 381
|
||||
|
||||
def reset(self):
|
||||
self.activate()
|
||||
self.first_pressed = False
|
||||
self.first_pressed_elapsed = 0
|
||||
self.text.set_frameset("full")
|
||||
for button in self.buttons:
|
||||
button.unhide()
|
||||
|
||||
def activate(self):
|
||||
self.active = True
|
||||
|
@ -277,7 +324,7 @@ class Title(GameChild):
|
|||
if not self.first_pressed and self.get_game().platform.get_edge_pressed() == NS.N:
|
||||
self.first_pressed = True
|
||||
self.first_pressed_elapsed = 0
|
||||
self.text.set_frameset("half")
|
||||
self.buttons[0].hide()
|
||||
self.button_sound.play()
|
||||
elif not wipe.is_playing() and self.first_pressed and \
|
||||
self.get_game().platform.get_edge_pressed() == NS.NW:
|
||||
|
@ -288,10 +335,12 @@ class Title(GameChild):
|
|||
if self.first_pressed_elapsed > 4000:
|
||||
self.first_pressed = False
|
||||
self.first_pressed_elapsed = 0
|
||||
self.text.set_frameset("full")
|
||||
self.buttons[0].unhide()
|
||||
self.border.update()
|
||||
self.text.update()
|
||||
self.draw_scores()
|
||||
for button in self.buttons:
|
||||
button.update()
|
||||
|
||||
|
||||
class Dialogue(Animation):
|
||||
|
@ -529,31 +578,54 @@ class Introduction(Animation):
|
|||
self.skip_prompt.update()
|
||||
|
||||
|
||||
class SkipPrompt(Sprite):
|
||||
class SkipPrompt(GameChild):
|
||||
|
||||
def __init__(self, parent, callback):
|
||||
Sprite.__init__(self, parent)
|
||||
GameChild.__init__(self, parent)
|
||||
self.callback = callback
|
||||
for ii in xrange(3):
|
||||
self.load_from_path(self.get_resource("Skip_%i.png" % ii), True)
|
||||
self.add_frameset([ii])
|
||||
self.buttons = []
|
||||
self.pluses = []
|
||||
top = 3
|
||||
left = 3
|
||||
for ii, edge in enumerate((NS.S, NS.NE, NS.W)):
|
||||
self.buttons.append(Button(self, edge, AdvancePrompt.BUTTON_SIZE,
|
||||
AdvancePrompt.BUTTON_BORDER))
|
||||
self.buttons[-1].location.topleft = left, top
|
||||
if ii < 2:
|
||||
self.pluses.append(Sprite(self))
|
||||
self.pluses[-1].load_from_path(self.get_resource("Plus.png"), True)
|
||||
self.pluses[-1].location.center = (
|
||||
self.buttons[-1].location.right + AdvancePrompt.BUTTON_SPACING / 2,
|
||||
self.buttons[-1].location.centery)
|
||||
left += self.buttons[-1].location.width + AdvancePrompt.BUTTON_SPACING
|
||||
self.text = Sprite(self)
|
||||
font = Font(self.get_resource(Dialogue.FONT_PATH), 18)
|
||||
self.text.add_frame(font.render("TO SKIP", True, (0, 0, 0)))
|
||||
self.text.location.midleft = (
|
||||
self.buttons[2].location.right + 5,
|
||||
self.buttons[2].location.centery)
|
||||
self.button_sound = self.get_game().sfx["button"]
|
||||
|
||||
def reset(self):
|
||||
self.press_index = 0
|
||||
self.press_elapsed = 0
|
||||
self.set_frameset(1)
|
||||
for button in self.buttons:
|
||||
button.unhide()
|
||||
for plus in self.pluses:
|
||||
plus.unhide()
|
||||
|
||||
def update(self):
|
||||
platform = self.get_game().platform
|
||||
if self.press_index == 0 and platform.get_edge_pressed() == NS.S:
|
||||
self.press_index += 1
|
||||
self.set_frameset(2)
|
||||
self.button_sound.play()
|
||||
self.buttons[0].hide()
|
||||
self.pluses[0].hide()
|
||||
elif self.press_index == 1 and platform.get_edge_pressed() == NS.NE:
|
||||
self.press_index += 1
|
||||
self.set_frameset(3)
|
||||
self.button_sound.play()
|
||||
self.buttons[1].hide()
|
||||
self.pluses[1].hide()
|
||||
elif self.press_index == 2 and platform.get_edge_pressed() == NS.W:
|
||||
self.callback()
|
||||
self.get_game().sfx["confirm"].play()
|
||||
|
@ -561,36 +633,52 @@ class SkipPrompt(Sprite):
|
|||
self.press_elapsed += self.get_game().time_filter.get_last_frame_duration()
|
||||
if self.press_elapsed > 4000:
|
||||
self.reset()
|
||||
Sprite.update(self)
|
||||
for button in self.buttons:
|
||||
button.update()
|
||||
for plus in self.pluses:
|
||||
plus.update()
|
||||
self.text.update()
|
||||
|
||||
|
||||
class AdvancePrompt(Sprite):
|
||||
class AdvancePrompt(GameChild):
|
||||
|
||||
BUTTON_SIZE = 8
|
||||
BUTTON_BORDER = 1
|
||||
BUTTON_SPACING = 27
|
||||
|
||||
def __init__(self, parent):
|
||||
Sprite.__init__(self, parent)
|
||||
self.load_from_path(self.get_resource("Dialogue_buttons_full.png"), True,
|
||||
False, (255, 255, 255))
|
||||
self.load_from_path(self.get_resource("Dialogue_buttons_half.png"), True,
|
||||
False, (255, 255, 255))
|
||||
self.add_frameset([0], name="full", switch=True)
|
||||
self.add_frameset([1], name="half")
|
||||
GameChild.__init__(self, parent)
|
||||
dsr = self.get_display_surface().get_rect()
|
||||
self.location.bottomright = dsr.right - 3, dsr.bottom - 3
|
||||
self.buttons = Button(self, NS.N, self.BUTTON_SIZE, self.BUTTON_BORDER), \
|
||||
Button(self, NS.NW, self.BUTTON_SIZE, self.BUTTON_BORDER)
|
||||
self.buttons[1].location.bottomright = dsr.right - 3, dsr.bottom - 3
|
||||
self.buttons[0].location.bottomright = (
|
||||
self.buttons[1].location.right - self.buttons[0].location.w - self.BUTTON_SPACING,
|
||||
self.buttons[1].location.bottom)
|
||||
self.plus = Sprite(self)
|
||||
self.plus.load_from_path(self.get_resource("Plus.png"), True)
|
||||
self.plus.location.center = self.buttons[1].location.left - self.BUTTON_SPACING / 2, \
|
||||
self.buttons[1].location.centery
|
||||
|
||||
def reset(self):
|
||||
self.cancel_first_press()
|
||||
for button in self.buttons:
|
||||
button.unhide()
|
||||
self.plus.unhide()
|
||||
|
||||
def cancel_first_press(self):
|
||||
self.first_pressed = False
|
||||
self.first_pressed_elapsed = 0
|
||||
self.set_frameset("full")
|
||||
self.buttons[0].unhide()
|
||||
self.plus.unhide()
|
||||
|
||||
def check_first_press(self):
|
||||
return not self.first_pressed and self.get_game().platform.get_edge_pressed() == NS.N
|
||||
|
||||
def press_first(self):
|
||||
self.first_pressed = True
|
||||
self.set_frameset("half")
|
||||
self.buttons[0].hide()
|
||||
self.plus.hide()
|
||||
self.get_game().sfx["button"].play()
|
||||
|
||||
def check_second_press(self):
|
||||
|
@ -604,7 +692,9 @@ class AdvancePrompt(Sprite):
|
|||
self.first_pressed_elapsed += self.get_game().time_filter.get_last_frame_duration()
|
||||
if self.first_pressed_elapsed > 4000:
|
||||
self.cancel_first_press()
|
||||
Sprite.update(self)
|
||||
for button in self.buttons:
|
||||
button.update()
|
||||
self.plus.update()
|
||||
|
||||
|
||||
class Wipe(Animation):
|
||||
|
|
Before Width: | Height: | Size: 193 B |
Before Width: | Height: | Size: 152 B |
After Width: | Height: | Size: 137 B |
Before Width: | Height: | Size: 1008 B |
Before Width: | Height: | Size: 994 B |
Before Width: | Height: | Size: 950 B |
Before Width: | Height: | Size: 303 B After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 4.0 KiB |
|
@ -13,11 +13,11 @@
|
|||
So you think you can skateboard, but can you <i>scrape</i>board, you slime bag?
|
||||
</div>
|
||||
<div id="boarding">
|
||||
<a href="www/Boarding_1_thumb.gif"><img src="www/Boarding_1.gif" width="250" /></a>
|
||||
<a href="www/Boarding_0_thumb.gif"><img src="www/Boarding_0.gif" width="250" /></a>
|
||||
<a href="www/Multiplay-Closing_Flan_thumb.gif"><img src="www/Multiplay_Closing-Flan.gif" width="250" /></a>
|
||||
<a href="www/Boarding_2_thumb.gif"><img src="www/Boarding_2.gif" width="250" /></a>
|
||||
<a href="www/Boarding_3_thumb.gif"><img src="www/Boarding_3.gif" width="250" /></a>
|
||||
<a href="www/Boarding_1.gif"><img src="www/Boarding_1_thumb.gif" width="250" /></a>
|
||||
<a href="www/Boarding_0.gif"><img src="www/Boarding_0_thumb.gif" width="250" /></a>
|
||||
<a href="www/Multiplay_Closing-Flan.gif"><img src="www/Multiplay_Closing-Flan_thumb.gif" width="250" /></a>
|
||||
<a href="www/Boarding_2.gif"><img src="www/Boarding_2_thumb.gif" width="250" /></a>
|
||||
<a href="www/Boarding_3.gif"><img src="www/Boarding_3_thumb.gif" width="250" /></a>
|
||||
</div>
|
||||
<div id="blob">
|
||||
<div id="detail">
|
||||
|
|
After Width: | Height: | Size: 390 KiB |