Links und Funktionen
Sprachumschaltung

Navigationspfad


Inhaltsbereich

Marios Spielfigur

Python Source icon figure Mario.py — Python Source, 2 KB (2532 bytes)

Dateiinhalt

#author:    Mario G.
#date:      22.03.2013
#version:   1.1
#name:      frosty

#changelog: 1.1
#           label (name) added


from visual import *


class Spielfigur_Mario (frame):
    def __init__(self, farbeCube=color.red, farbeSpikes=(0/255.0, 255/255.0, 0/255.0), stoffCube= materials.wood, stoffSpikes= materials.blazed, farbeFace= (255/255.0, 68/255.0, 0/255.0), stoffFace= materials.rough, farbeOthers= (0/255.0, 255/255.0, 0/255.0), stoffOthers= materials.chrome, spielerfarbe1= color.green, spielername= "player1"):
        frame.__init__(self)
        self.cube= box(pos=(0.5,0.5,0.5), length=1, heigh=1, width=1,color=farbeCube, material=stoffCube, frame=self)
        self.spike1= cone (axis=(-0.5,0,0), pos=(0, 0.5,0.5), frame=self, radius= 0.2, color=farbeSpikes, material= stoffSpikes)
        self.spike2= cone (axis=(0,0,-0.5), pos=(0.5, 0.5, 0), frame=self,radius= 0.2, color=farbeSpikes, material= stoffSpikes)
        self.spike3= cone (axis=(0.5, 0, 0), pos=(1,0.5,0.5), frame=self,radius= 0.2, color=farbeSpikes, material= stoffSpikes)
        self.spike4= cone (axis=(0, 0.5, 0), pos=(0.5,1,0.5), frame=self,radius= 0.2, color=farbeSpikes, material= stoffSpikes)
        self.spikeDown= cone (axis=(0, -1, 0), pos=(0.5,0,0.5), frame=self,radius= 0.2, color=farbeSpikes, material= stoffSpikes)
        self.eye1=  sphere(radius=0.1, pos=(0.25, 0.75, 1), frame=self, color= farbeFace, material= stoffFace)
        self.eye2=  sphere(radius=0.1, pos=(0.75, 0.75, 1), frame=self, color= farbeFace, material= stoffFace)
        self.nose= cone (axis=(0, 0, 0.25), pos=(0.5,0.5,1), frame=self,radius= 0.1, color=farbeSpikes, material= stoffSpikes)
        self.mouth= ellipsoid (axis=(0.5,0,0), pos=(0.5,0.2,1), width=0.1, height= 0.22, length= 0.2, frame=self,radius= 0.2, color= farbeFace, material= stoffFace)             
        #self.mouth= box(pos=(0.5, 0.2, 1), axis=(1, 0, 0), width=0.2, height=0.1, length= 0.5, frame=self, color= farbeFace, material= stoffFace)
        self.plate= cylinder (pos=(0.5, -1, 0.5), axis= (0,0.05,0),radius=0.75, frame= self,color= farbeOthers, material= stoffOthers)
        self.ring= ring (pos=(0.5, -0.75, 0.5), axis= (0,0.02,0),radius=0.5, frame= self, color= farbeOthers, material= stoffOthers)
        self.ring2= ring (pos=(0.5, -0.5, 0.5), axis= (0,0.02,0),radius=0.3, frame= self, color= farbeOthers, material= stoffOthers)
        self.name= label(pos=(0.5, 2, 0.5), linecolor= spielerfarbe1, frame= self, text= spielername)

     


frosty=Spielfigur_Mario()


Funktionsleiste