changeset 90:97996cdd1a53

merge
author Michael Rochseter <m.rochester93@googlemail.com>
date Sun, 08 Jul 2012 15:04:20 +0200
parents 35f4c26609fc (current diff) d142c245fd31 (diff)
children c52441feb981
files zrpn/client.py zrpn/display.py zrpn/server.py
diffstat 12 files changed, 49 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/README.rst	Sun Jul 08 15:01:30 2012 +0200
+++ b/README.rst	Sun Jul 08 15:04:20 2012 +0200
@@ -10,10 +10,10 @@
 How to play.
 ============
 
-Zombies, Robots, Pirates and Ninjas have gotten together to rain Match Five 
+Zombies, Robots, Pirates and Ninjas have gotten together to rain Match Five
 destruction on the universe.
 
-You must join together with other players over "the internet" to rain 
+You must join together with other players over "the internet" to rain
 destruction on them.
 
 
@@ -50,7 +50,7 @@
 Development notes
 =================
 
-Below are some development notes.  About what all the files are, and where 
+Below are some development notes.  About what all the files are, and where
 they are.
 
 
@@ -169,8 +169,21 @@
 >>> data_dir('sounds', 'play.ogg')
 'zrpn/data/sounds/play.ogg'
 
-It will give you the path to the file you requested, but will 
-work cross platform.  Since your files could be in different places on 
+It will give you the path to the file you requested, but will
+work cross platform.  Since your files could be in different places on
 different platforms.
 
+Data
+====
 
+Sounds
+------
+
+
+Fonts
+-----
+
+* http://www.fontsquirrel.com/fonts/Pincoyablack
+* http://www.fontsquirrel.com/fonts/GoodDog
+
+
--- a/zrpn/client.py	Sun Jul 08 15:01:30 2012 +0200
+++ b/zrpn/client.py	Sun Jul 08 15:04:20 2012 +0200
@@ -11,17 +11,25 @@
 
 import display
 import packets
+from skelutil import data_dir
 
 
 class Client(object):
     def __init__(self, address, port):
         self.display = display.Display()
+
+
+
+        
         self.connected = False
         self.client = net.Client()
         self.connection = self.client.connect(address, port)
-        self.lbl_time = sgc.Label(pos=(0, 0), text="time\nwasted=\n0")
-        self.lbl_score = sgc.Label(pos=(0, 70), text="score=\n0")
-        self.lbl_highscore = sgc.Label(pos=(0, 120), text="First=\n0")
+
+        self.font = pygame.font.Font(data_dir("GoodDog.otf"), 16)
+
+        self.lbl_time = sgc.Label(pos=(0, 0), text="time\nwasted=\n0", font=self.font)
+        self.lbl_score = sgc.Label(pos=(0, 70), text="score=\n0", font=self.font)
+        self.lbl_highscore = sgc.Label(pos=(0, 120), text="First=\n0", font=self.font)
 
         w = [self.lbl_time, self.lbl_score, self.lbl_highscore]
 
@@ -38,6 +46,10 @@
                 elif event.type == pygame.MOUSEBUTTONDOWN:
                     x, y = event.pos[0] // 24, event.pos[1] // 24
                     self.connection.net_click(x, y)
+
+
+
+
                 elif event.type == net.event.NETWORK:
                     if event.net_type == net.event.NET_RECEIVED:
                         if event.p_type == packets.INIT:
@@ -45,6 +57,11 @@
                                     event.packet.sprites)
                         elif event.p_type == packets.ANIMATIONS:
                             self.display.do_animations(event.packet.animations)
+
+
+                            
+
+
                         elif event.p_type == packets.SCORE:
                             self.lbl_score.config(text="score=\n" + str(event.packet.score_num))
                             self.lbl_highscore.config(text="first=\n" + str(event.packet.highscore))
Binary file zrpn/data/GoodDog.otf has changed
Binary file zrpn/data/ninja.ogg has changed
Binary file zrpn/data/pincoyablack.otf has changed
Binary file zrpn/data/pirate.ogg has changed
Binary file zrpn/data/robot.ogg has changed
Binary file zrpn/data/zombie.ogg has changed
--- a/zrpn/main.py	Sun Jul 08 15:01:30 2012 +0200
+++ b/zrpn/main.py	Sun Jul 08 15:04:20 2012 +0200
@@ -11,7 +11,7 @@
 import display
 import client
 import logging
-
+from skelutil import data_dir
 
 
 
@@ -58,18 +58,22 @@
 
 
 def main():
+
+    
     screen = display.Display()
 
+    pygame.display.set_caption("Zombies Robots Pirates Ninjas")
 
+    sgc.Font.set_fonts({"title": data_dir("pincoyablack.otf")}, size=60)
+
+    default_host = "localhost"
     default_host = "zrpn.pygame.org"
-    default_host = "localhost"
     menu = MainMenu(menu=("m:Zombies Robots Pirates Ninjas", ("f:single", "Single Player"),
                           ("w:input_box", "name=ip", "text={}".format(default_host),
                            "label=Enter IP for multiplayer server(eg. localhost)"),
                           ("f:multi", "Multiplayer"), ("f:exit", "Quit")))
     menu.screen = screen
 
-    pygame.display.set_caption("Zombies Robots Pirates Ninjas")
 
     clock = pygame.time.Clock()
     menu.add(0)
--- a/zrpn/server.py	Sun Jul 08 15:01:30 2012 +0200
+++ b/zrpn/server.py	Sun Jul 08 15:04:20 2012 +0200
@@ -15,7 +15,7 @@
 
     def net_click(self, channel, packet_id, packet):
         t = time.time()
-        if t - self.click_time < 1:
+        if t - self.click_time < 0.5:
             return
         self.click_time = t
         animations = self.board.kill_one(packet)
--- a/zrpn/sgc/widgets/_locals.py	Sun Jul 08 15:01:30 2012 +0200
+++ b/zrpn/sgc/widgets/_locals.py	Sun Jul 08 15:04:20 2012 +0200
@@ -239,7 +239,7 @@
     col = (255,255,255)
 
     @classmethod
-    def set_fonts(cls, fonts={}):
+    def set_fonts(cls, fonts={}, size=16):
         """
         Set fonts to a specific font. If a font exists, it will be replaced,
         otherwise it will be newly created.
@@ -253,7 +253,7 @@
         for font in fonts:
             if font not in cls._fonts:
                 cls._fonts[font] = _Font()
-            cls._fonts[font].replace(cls._create_font(fonts[font], 16))
+            cls._fonts[font].replace(cls._create_font(fonts[font], size))
 
         if not cls._fonts["widget"]:
             cls._fonts["widget"].replace(cls._create_font("Arial", 16))
--- a/zrpn/sprites.py	Sun Jul 08 15:01:30 2012 +0200
+++ b/zrpn/sprites.py	Sun Jul 08 15:04:20 2012 +0200
@@ -33,6 +33,7 @@
         self.rect.topleft = x * 24, y * 24
         self.animations = [self.anim_wait(1)]
         self.last_delay = 0
+        self.kind = kind
 
     def update(self):
         self.dirty = 0