pok_f.py

Created by pikube

Created on December 12, 2019

2.91 KB

ATTENTION: Ce programme exige toute la mémoire de la calculatrice, et est couplé aux autres scripts commençeant par pok_ (s,c,m, et a). Il requiert OMEGA 1.16.0-0 (allez voir https://github.com/Omega-Numworks/Omega).

Ce script contient une partie importante des images, en plus de la classe pokémon.


from math import *
from kandinsky import *
from pok_c import chapeau
class pokemon():
  def __init__(self,draw,vars,pv,actions,fear):#actions is the attacks graphism
    self.draw=draw
    #vars cotains arguments for the draw method 
    self.x=vars[0]
    self.y=vars[1]
    self.c=vars[2]
    self.size=vars[3]
    self.vx=vars[4]
    self.pv=pv
    self.pvmax=pv
    self.fear=fear
    self.actions=actions
  def render(self):
    self.draw(self.x,self.y,self.c,self.size)
  def degat(self):
    self.actions[0](self.x,self.y,self.size,self.c,self.draw,0)#vx doesnt matter  
  def special(self):
    self.actions[2](self.x,self.y,self.size,self.c,self.draw,copysign(6,self.vx))
  def charge(self):
    self.actions[1](self.x,self.y,self.size,self.c,self.draw,self.vx)
  def rage(self):
    self.actions[3](self.x,self.y,self.size,self.c,self.draw,self.vx)
def fill(a,b,c,d,e):
  fill_rect(int(a),int(b),int(c),int(d),e)
def jambes(x,y,c,size):
  c0,c1,c2=int(c[0]/1.4),int(c[1]/1.4),int(c[2]/1.4)
  fill(x-2*size,y+7*size,2*size,5*size,(c0,c1,c2))
  fill(x-3*size,y+14*size,4*size,10*size,(c0,c1,c2))
  fill(x+20*size,y+7*size,2*size,5*size,(c0,c1,c2))
  fill(x+19*size,y+14*size,4*size,10*size,(c0,c1,c2))
def body(x,y,c,size):
  fill(x,y,20*size,20*size,(int(c[0]/1.2),int(c[1]/1.2),int(c[2]/1.2)))
  fill(x+4*size,y+12*size,12*size,8*size,c)
  fill(x+4*size,y+4*size,4*size,4*size,(0,0,0))
  fill(x+13*size,y+size*4,4*size,4*size,(0,0,0))
def ailes(x,y,c0,size):
  c=[230,230,230]
  if c0==[0,0,0]:
    c=[0,0,0]
  fill(x-5*size,y-4*size,5*size,17*size,c)
  fill(x+20*size,y-4*size,5*size,17*size,c)
  fill(x-6*size,y-4*size,size,7*size,c)
  fill(x+25*size,y-4*size,size,7*size,c)
def tail(x,y,c,size):
  c0=int(c[0]/1.3)
  c1=int(c[1]/1.3)
  c2=int(c[2]/1.3)
  fill(x+20*size,y+15*size,3*size,3*size,(c0,c1,c2))
  fill(x+21*size,y+4*size,5*size,14*size,(c0,c1,c2))
  fill(x+21*size,y+4*size,8*size,5*size,(c0,c1,c2))
  fill(x+28*size,y+4*size,size,5*size,(0,0,0))
def flamme(x,y,c,size):
  fill(x+2*size,y-size,16*size,size,c)
  fill(x+4*size,y-2*size,12*size,size,c)
  fill(x+5*size,y-3*size,6*size,size,c)
  fill(x+7*size,y-4*size,3*size,size,c)
  fill(x+12*size,y-6*size,size,size,c)
def pika(x,y,c,size):
  body(x,y,c,size)
  tail(x,y,c,size)
  chapeau(x,y,c)
def mymig(x,y,c,size):
  body(x,y,c,size)#(212,250,162),size)
  #les pattes sont jaunes!
  jambes(x,y,c,size)#(1.2*212,1.2*250,1.2*162),size)
  chapeau(x,y,c)
def tylton(x,y,c,size):
  body(x,y,c,size)
  ailes(x,y,c,size)
  chapeau(x,y,c)
def flameu(x,y,c,size):
  body(x,y,c,size)
  flamme(x,y,c,size)
  chapeau(x,y,c)
def txtbx():
  fill(0,130,320,222-129,(255,255,255))
  fill(1,131,320-2,222-127,(0,0,0))
def triangle(x,y):
  for loop in range(7):
    fill(x+loop,y+loop-7,1,14-2*loop,(255,255,255))
def health(percent,x,y):
  fill(x,0,100,4,(255,0,0))
  fill(x,0,int((percent+abs(percent))/2),4,(0,255,0))
def reload():
  fill(0,0,320,222,(0,0,0))
#la depression est le propre de l homme

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.