Links und Funktionen
Sprachumschaltung

Navigationspfad


Inhaltsbereich

world1.4

KaptludoWorld-3.py — text/python-source, 3 KB (3899 bytes)

Dateiinhalt

from visual import *
from random import*


colors=[color.yellow,color.magenta,color.black,color.green,color.orange,color.white,color.blue,color.cyan,color.red]
scene.forward = (0,-3,0)
scene.center = (50,0,50)
ground = box(pos=(50,-0.5,50), length=100, height=0.1, width=100, material=materials.rough)
landscape = box(pos=(50,-0.5,50), length=101, height=30, width=101, material=materials.earth)#, opacity=0)

class house():    #class house
    def __init__(self, px, pz, pLength, pWidth, pcolor=color.cyan):                            #__init__
        a = box(pos=(px, 4.5, pz), length=pLength, height=10, width=pWidth, color=pcolor)
        b = curve(pos=[(px+0.5*pLength,0,pz+0.5*pWidth),(px-0.5*pLength,0,pz+0.5*pWidth),(px-0.5*pLength,0,pz-0.5*pWidth),(px+0.5*pLength,0,pz-0.5*pWidth),(px+0.5*pLength,0,pz+0.5*pWidth)])

#outer walls
wall1=house(50,0.5,100,1,colors[randint(0,8)])
wall2=house(50,99.5,100,1,colors[randint(0,8)])
wall3=house(0.5,50,1,100,colors[randint(0,8)])
wall4=house(99.5,50,1,100,colors[randint(0,8)])

#inner cross
house1=house(25,50,40,1,colors[randint(0,8)])
house2=house(75,50,40,1,colors[randint(0,8)])
house3=house(50,25,1,40,colors[randint(0,8)])
house4=house(50,75,1,40,colors[randint(0,8)])

#central walls
house5=house(43.25,40,7.5,1,colors[randint(0,8)])
house6=house(56.75,40,7.5,1,colors[randint(0,8)])
house7=house(43.25,60,7.5,1,colors[randint(0,8)])
house8=house(56.75,60,7.5,1,colors[randint(0,8)])
house9=house(40,43.25,1,7.5,colors[randint(0,8)])
house10=house(60,43.25,1,7.5,colors[randint(0,8)])
house11=house(40,56.75,1,7.5,colors[randint(0,8)])
house12=house(60,56.75,1,7.5,colors[randint(0,8)])

#sector I
bubble1 = sphere(pos=(65,1,15), radius=5, color = colors[randint(0,8)])
bubble2 = sphere(pos=(75,-2,23), radius=7, color = colors[randint(0,8)])
bubble3 = sphere(pos=(80,4.5,35), radius=5, color = colors[randint(0,8)])
bubble4 = sphere(pos=(90,1,5), radius=6, color = colors[randint(0,8)])
bubble5 = sphere(pos=(70,5.5,44), radius=6, color = colors[randint(0,8)])
bubble6 = sphere(pos=(60,5,29), radius=5, color = colors[randint(0,8)])
bubble7 = sphere(pos=(90,3,23), radius=5, color = colors[randint(0,8)])
bubble8 = sphere(pos=(95,5,37), radius=7, color = colors[randint(0,8)])


#sector II
dice1=house(34.5,47,6,6,colors[randint(0,8)])
dice2=house(29.5,42,6,6,colors[randint(0,8)])
dice3=house(40,34,6,6,colors[randint(0,8)])
dice4=house(47,25,6,6,colors[randint(0,8)])
dice5=house(42,15,6,6,colors[randint(0,8)])
dice6=house(37,10,6,6,colors[randint(0,8)])
dice7=house(34,25,6,6,colors[randint(0,8)])
dice8=house(29,30,6,6,colors[randint(0,8)])
dice9=house(25,15,6,6,colors[randint(0,8)])
dice10=house(20,12,6,6,colors[randint(0,8)])
dice11=house(15,17,6,6,colors[randint(0,8)])
dice12=house(11,9,6,6,colors[randint(0,8)])
dice13=house(11,29,6,6,colors[randint(0,8)])
dice14=house(16,34,6,6,colors[randint(0,8)])
dice15=house(11,39,6,6,colors[randint(0,8)])

#sector III
walllab1=house(10,54,1,8,colors[randint(0,8)])
walllab2=house(8,62,16,1,colors[randint(0,8)])
walllab3=house(16,58.5,1,8,colors[randint(0,8)])
walllab4=house(5,80,10,1,colors[randint(0,8)])
walllab5=house(10,80,1,20,colors[randint(0,8)])
walllab6=house(8,90,5,1,colors[randint(0,8)])
walllab7=house(10,70,10,1,colors[randint(0,8)])
walllab8=house(30,60,1,20,colors[randint(0,8)])
walllab9=house(28,70,5,1,colors[randint(0,8)])
walllab10=house(26,68,1,4,colors[randint(0,8)])
walllab11=house(26,92,1,16,colors[randint(0,8)])
walllab12=house(34,84,17,1,colors[randint(0,8)])
walllab13=house(42,89,1,10,colors[randint(0,8)])
walllab14=house(40.5,94,4,1,colors[randint(0,8)])
walllab15=house(45,70,10,1,colors[randint(0,8)])
walllab16=house(40,70,1,12,colors[randint(0,8)])

#main base circle
base =cylinder(pos=(50,-0.5,50), axis=(0,0.11,0), radius=0.5, material=materials.emissive, color=color.red, opacity=0.3)
baselamp = local_light(pos=(50,2,50), color=color.red)


Funktionsleiste