示例#1
0
文件: player.py 项目: jolark/MaxPaint
    def __init__(self):
        super(Player, self).__init__()
        # physics properties
        self.x_vel            = self.y_vel = self.y_vel_i = 0
        self.grav             = 20
        self.fall             = False
        self.time             = 0 # None
        self.speed            = 10
        self.jump_power       = 10
        self.rect             = Rect(0, 0, 60, 60)
        self.rect.topleft     = (150,3000)
        self.collide_ls       = [] #what obstacles does the player collide with
        self.direction        = 1
        self.direction_offset = 0
        self.animation_offset = 0
        self.animationTicks   = 0
        self.spidering        = False
        self.onBlock          = None
        self.finished         = False
        self.kup_pressed      = False
        
        # game properties
        self.bullets          = []
        self.mines            = 0
        self.minesCount       = 0
        self.mining           = False
        self.slomoDelay       = 0
        self.shields          = 0
        self.shieldsCount     = 0
        self.shieldDelay      = 0
        self.killed           = False
        self.hit              = False
        self.hitDelay         = 0
        self.timePower        = 0
        self.timePowerCount   = 0


        # pics, anims and sound
        self.shieldAnim  = pyganim.loadAnim('../img/anims/shield',0.1,True)
        self.timeAnim    = pyganim.loadAnim('../img/anims/time',0.1,True)
        self.shootSound  = pygame.mixer.Sound("../sounds/playerShoot.wav")
        self.shieldSound = pygame.mixer.Sound("../sounds/playerShield.wav")
        self.hitSound    = pygame.mixer.Sound("../sounds/playerHit.wav")
        self.noteRed     = pygame.mixer.Sound('../sounds/notes/plouit_red.wav')
        self.noteBlue    = pygame.mixer.Sound('../sounds/notes/plouit_blue.wav')
        self.noteYellow  = pygame.mixer.Sound('../sounds/notes/plouit_yellow.wav')


        self.img = pygame.image.load("../img/player/kube_new_pix.png").convert_alpha()
示例#2
0
文件: utils.py 项目: jolark/MaxPaint
'''
Utils
'''
import sys
import pygame
import math
import random
import shelve
sys.path.append('../lib/pyganim/')
import pyganim


plusOneAnimBlue = pyganim.loadAnim('../img/anims/plusOne/blue/',0.05)
plusOneAnimYellow = pyganim.loadAnim('../img/anims/plusOne/yellow/',0.05)
plusOneAnimRed = pyganim.loadAnim('../img/anims/plusOne/red/',0.05)

questions = ["What's your name ?",
            "Are you alone ?",
            "Do you need anything ?",
            "Do you know where you are ?",
            "How do you feel ?",
            "Would you like to talk to me now?",
            "Is this the end ?"]
answers = [["This is none of your business.", "Who are YOU ?", "I don't remember..."],
            ["No, there was someone at the end of the previous level !", "Yes, fortunately nobody is with me.", "I should go back to check..."],
            ["I need to slow time...", "I need more protection.", "Give me a weapon, I need to defend myself !"],
            ["This is Heaven...", "Clearly I'm in Hell.", "Of course, I'm in the middle of a game !"],
            ["Not too well, I feel like I've died a thousand times.", "To be honest this isn't much fun...", "I'm on fire, nothing can stop me !"],
            ["I'd rather not.", "I never wanted to talk to you in the first place !", "I wish, but this is not implemented in the game..."],
            ["It'd better be, I'm wasting my time here.", "Isn't there another level ?", "Gnnnnraaaaaahh !!"]
            ]