venture.py

Created by aidanplews2013

Created on October 03, 2021

12.6 KB

the python “RPG” i couldnt fit a combat system so just press ok to exit battles


from kandinsky import *
import random
cx=0
go=True
bats=True
cy=0
mx=2
my=7
cs=16
enc=100
from ion import *
print("f")
chunk=[[0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0],[21,20,21,21,21,21,21,19,21,21,21,20,21,19,21,21],[20,20,0,20,21,21,20,21,21,21,21,21,21,19,21,21],[21,20,21,21,21,21,21,21,21,19,21,21,19,0,19,19],[20,1,0,0,19,0,0,1,0,0,0,0,0,1,0,0],[0,1,0,20,0,0,0,19,0,1,0,0,0,0,0,1],[1,0,0,0,0,0,0,1,20,0,0,0,19,1,0,0],[0,1,0,0,0,0,0,1,0,0,0,20,0,1,0,19],[0,0,0,1,1,20,20,0,0,19,19,0,0,0,1,0],[0,0,0,1,26,26,26,26,29,29,29,29,0,1,0,0],[0,35,0,1,1,25,26,26,0,28,29,29,0,0,0,0],[1,0,36,0,26,26,27,0,29,29,30,1,0,0,0,0],[0,35,0,0,0,35,1,0,1,35,0,0,0,35,0,1],[1,0,36,0,0,0,36,1,0,1,36,0,0,0,36,0],[1,0,0,0,26,31,0,1,29,35,0,0,0,35,0,0],[0,0,1,0,0,0,32,26,1,0,36,29,0,0,36,0,],[16,16,16,0,15,6,15,0,1,0,1,0,0,0,0,0],[26,26,26,26,23,23,7,23,0,1,0,1,0,0,0,0],[1,0,1,0,26,5,26,26,29,5,29,29,1,0,1,0]]
mapp=[[2,2,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,2,2],[2,4,5,6,9,9,1,1,7,6,8,7,7,6,5,1,7,1,7,7,6,8,8,6,8,7,8,7,9,6,4,2],[2,5,5,7,5,1,5,5,6,5,1,8,6,5,5,8,5,8,9,6,6,1,8,5,6,1,6,7,7,6,6,2],[2,7,6,6,5,6,7,5,6,5,6,5,7,8,5,8,8,7,1,6,6,7,7,5,7,6,8,1,8,6,7,2],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5,6,6,5,5,6,8,2],[2,8,5,7,8,8,1,5,8,1,5,5,5,7,1,9,6,5,7,8,1,7,6,9,6,7,6,1,5,7,8,2],[2,6,8,6,6,6,1,8,5,6,6,9,9,8,1,6,9,5,9,9,9,9,9,8,5,6,9,8,9,7,7,2],[2,7,1,7,7,9,9,9,9,8,8,5,9,1,7,9,1,8,8,7,1,9,6,7,1,8,9,7,6,7,6,2],[2,1,8,1,8,9,8,9,7,9,9,9,6,6,9,7,5,5,6,7,9,8,5,8,7,1,5,9,1,7,5,2],[2,5,8,9,5,6,9,8,9,6,5,5,8,1,5,6,9,5,6,7,1,8,7,6,8,6,5,8,1,8,6,2],[2,5,5,5,6,9,9,1,6,6,1,8,7,8,5,8,5,6,7,8,8,9,7,6,6,7,8,7,6,6,9,2],[2,1,1,6,5,6,6,8,5,9,7,5,1,7,7,8,8,6,1,9,1,6,5,1,8,6,9,9,7,6,5,2],[2,9,7,5,5,7,1,8,1,9,5,7,8,6,6,6,1,7,1,9,7,8,7,6,7,1,7,8,5,1,7,2],[2,5,5,1,8,5,7,6,6,6,6,1,8,6,9,6,7,6,1,1,1,1,7,6,7,9,1,6,9,5,6,2],[2,7,1,6,5,6,5,8,6,5,9,6,9,5,9,5,6,6,6,9,9,9,6,1,5,8,6,9,8,5,8,2],[2,3,1,5,9,8,8,5,6,7,6,6,6,8,9,7,9,5,9,9,7,8,6,8,9,7,8,5,1,8,3,2],[2,2,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]]
player=[]
playerX=80
playerY=32
pdir=7



def drawplayer():
    global playerX
    global playery
    global pdir
    global font
    global enames
    b=[]
    o=0
    a=[[64575, 62415, 61431, 55291, 61175, 54523, 41845, 54667, 54699, 58311, 62511, 60375, 60375, 61455, 63087, 63903]]
    go=False
        
    for i in range(16):
            c=str('{0:016b}'.format(a[0][i]))

            c=c[(16*0):(16*(0+1))]
            c=int(c, 2)
            
            b.append(c)
            x=('{0:016b}'.format(b[i]))
            for o in range(16):
             aa=((playerX)+o)
             bj=((playerY)+i+10)-10
             cc=1
             d=1
             e=(255,255,255)

             bs=(0,0,0)
             inv=(0,0,0)
             if int(x[o])==0:
                fill_rect(aa,bj,1,1,(0,0,0))

                #canvas.create_rectangle(aa+2,bj+2,cc+aa+2,d+bj+2,fill=colr(inv),outline='')
            else:
                fill_rect(aa,bj,1,1,(255,255,255))
                #canvas.create_rectangle(aa+2,bj+2,cc+aa+2,d+bj+2,fill=colr(e),outline='')

def battle(enum):
    inv=(0,0,0)
    global enames
    global fonts
    global bats
    global enc
    global go
    fill_rect(0,0,500,300,(255,255,255))
    fill_rect(0,0,500,16,(0,0,0))
    fill_rect(0,50,500,64,(0,0,0))        
    a=[[18311635054033371135, 18298124151930486783, 18156206904713936895, 18156162099311280127, 18097620354517956639, 18003066863693461487, 11166398055487762423, 14776169151562636731, 14767056707203489211, 14780672026806575099, 10078983343541837435, 1990521660051144701, 1748487401909895165, 856235935212948531, 137620467043988431, 9285560697586778111]]
    while bats == True:
     b=[]
     for i in range(16):
            c=str('{0:064b}'.format(a[0][i]))

            c=c[(16*(enum)):(16*((enum)+1))]
            c=int(c, 2)
            
            b.append(c)
            x=('{0:016b}'.format(b[i]))
            for o in range(16):
             aa=((96)+(o*2))
             bj=(8+i)*2
             cc=2
             d=2
             e=(255,255,255)

             bs=(0,0,0)
             inv=(255,255,255)
             if int(x[o])!=0:
                fill_rect(aa+2,bj+2,cc,d,e)
          
             else:
                fill_rect(aa+2,bj+2,cc,d,bs)
             if (keydown(KEY_OK))==True:
                 enc=100
                 go=True

                 bats=False
         


battle(0)
a=[[4422089960626842619764039034596580768166164044354776223130324848793771862118341572464022692690566099238230961702884523183099346488920333065576418232205174744180200259009134028499782202017447935, 4418748269473566079092627085896488463212562832875431114099383592574680172439262473191090989048782302082481304262772814858636514610151934851293589900617730293557961193496400214434626944024707071, 4276726750790384626636077668366349889318399740933816737235665146985230521720194731484520101826968626054000251467684721159406093852722945800446046090323365218345979972837316518853617532268183551, 2565389276871649486010954841272621305308773962345883373033938880170465027247701036469963403478140948239125204538709684345543267806276414287614671896428570899057137572776775229342503479748591615, 3164380985697670325342681428462983066479346136084112320026048824781429009495852139352068020863904678350125762603863299518501255142194887855752487905329955241379078751288312641412829521997201407, 3706132793652890178648024226553513922493437533352861363187277903720420483104597083100863980882466026197448595600214690589114170594506274224405078183350780098011274786692092633643457350492225535, 3707807102426280984775111707302301579479595569593835247475223186975026301663476745719990564243769283365172830557894103019356937757431725112676500812789398374586595127975738145336089765279170559, 3848155617165064655652431973129217855262580092498709464842149805372547996395030492568782767372840122091023010060535885199191357220397823922329243875380181121567753925450094859851873580423839743, 4133032707957463673596239373612909514407675808524807276585735748308905518580201870247245615334865928793259961134474346752845661086435018051088584010234874960740480661694085273641504982930817023, 4418748277971777763155924357423663926142856983825930111096524185827940970191676693362095643011219771685077309090527222340274284568241102650846752722588327910098269404687808965701370671657910271, 4561883670217937213662142175018811762173876562937924716993557912544697337460083651590091126347198007514608676473485271355396682392595353701386928305466568660624298740795337201376931411998539775, 4562162143388931468123527154125271039235000800458293277634505068819697317164358424606619280887930348062456385723121160011165856535762810765655978023627782967572343349293594566601598903135502335, 4562440617351090358052899625990373634165745437654812765908295679324188312044716129742727407821040244898903106522592090767874397266407828788107611128388789192672407519047485086902934884170334207, 4562440616914013581112572557253437303879248124855626970691889776832048291824582114945335819881959240147403308665689027534670029699076476702464464857193935283144953434469053110249460923774271487, 4562440617268099920042416258144235820850066230388020193072715356435152264660074364780650266265160107434622609512086854626200048547422930038660610779396518589783106377590110340015062896185704447, 4562440616914014340911577322801046552488294444659412821371460981174612186192021671130689522388377264856128744512982147108337685945049861649117477585838163444154280872170572137174698103263985663]]
b=[]
##def onKeyPress(event):
##    global mx
##    global my
##    print(event.char,)
##    if str(event.char,)==("d"):
##        mx=mx+1
##    if str(event.char,)==("w"):
##        my=my+1
##    if str(event.char,)==("s"):
##        my=my-1
##    if str(event.char,)==("a"):
##        mx=mx-1
##    print(mx, my)
##    canvas.delete("all")

lin=[],[],[],[],[],[],[],[]
##root = tk
go==True
while go==True:
    lin=[],[],[],[],[],[],[],[]
    fill_rect(0,0,400,400,(255,255,255))
    drawplayer()
    for ary in range (2):
        for ard in range(3):
         
         ardd=(ard)*64
         mxx=mapp[my+ary][mx+ard]
         for xxxxx in range (16):
            #for cc in range (16):
            b=[]
            num=39-(chunk[mxx-1][(xxxxx)]) 
            if xxxxx<=3 and ary==0:
                lin[0].append(num)
            if xxxxx>3 and xxxxx<=7 and ary==0:
                lin[1].append(num)
            if xxxxx>7 and xxxxx<=11 and ary==0:
                lin[2].append(num)                
            if xxxxx>11 and xxxxx<=15 and ary==0:
                lin[3].append(num)

            if xxxxx<=3 and ary==1:
                lin[4].append(num)
            if xxxxx>3 and xxxxx<=7 and ary==1:
                lin[5].append(num)
            if xxxxx>7 and xxxxx<=11 and ary==1:
                lin[6].append(num)                
            if xxxxx>11 and xxxxx<=15 and ary==1:
                lin[7].append(num)

            for ii in range (16):
                
                c=str('{0:0640b}'.format(a[0][ii]))

                c=c[(16*num):(16*(num+1))]
                c=int(c, 2)
                
                b.append(c)

                
            from time import *

            mo=[b]
            
            for fap in range (1):#this is was used play back multiple frames of video just ignore it
               
              zy=mo[fap]
         
              for i in range(16):
                x=('{0:016b}'.format(zy[i]))
                for o in range(16):
                  
                  ov=o+ardd
                  

                  
                  if int(x[o])!=1:
                    aa=((cs*cx)+ov)
                    bj=((cs*(cy)+i+10)-10)+(ary*64)
                    cc=1
                    d=1
                    e=(255,255,255)

                    bs=(0,0,0)
                    
                    #canvas.create_rectangle(aa+2,bj+2,cc+aa+2,d+bj+2,fill=colr(e),outline='')
                    fill_rect(((cs*cx)+ov),bj,1,1,(0,0,0))
                    
            b=[]
            mo=[]
            cx=cx+1
            if cx>3:
                cy=cy+1
                cx=0
            if cy>3:
                cy=0
    go=False
    while go==False:
              
        if (keydown(KEY_RIGHT))==True and lin[int(playerY/16)][int((playerX+16)/16)]>33:
          fill_rect(playerX,playerY,16,16,(255,255,255))
          playerX=playerX+16
          pdir=5
          enc=random.randrange(100)
          drawplayer()
          
        if (keydown(KEY_LEFT))==True and lin[int(playerY/16)][int((playerX-16)/16)]>33:
          fill_rect(playerX,playerY,16,16,(255,255,255))
          playerX=playerX-16
          pdir=0
          enc=random.randrange(100)
          drawplayer()
        if (keydown(KEY_UP))==True and lin[int((playerY-16)/16)][int((playerX)/16)]>33:
          fill_rect(playerX,playerY,16,16,(255,255,255))
          playerY=playerY-16
          pdir=11
          enc=random.randrange(100)
          drawplayer()  
        if (keydown(KEY_DOWN))==True and lin[int((playerY+16)/16)][int((playerX)/16)]>33:
          fill_rect(playerX,playerY,16,16,(255,255,255))
          playerY=playerY+16
          pdir=6
          enc=random.randrange(100)
          drawplayer()
        if playerX==160+16:
           playerX=112
           mx=mx+1
           go=True
        if playerX==0:
           playerX=48+16
           mx=mx-1
           go=True
        if playerY==0:
           playerY=80-16
           my=my-1
           go=True
        if playerY==112:
           playerY=112-64
           my=my+1
           go=True
        if enc<5:
           enc=random.randrange(0,4)
           
           bats=True
           battle(enc)