chute_die_and_recry.py

Created by rockingchair1196

Created on May 17, 2025

6.35 KB

Salut ! Je suis RockingCha1r, et je vous présente la suite de mon mod Blood And Tears !

Chute : Die And Recry

Une version bien plus difficile du jeu Chute, créé par Antarctus.

Si vous n'avez pas encore joué à mon précédent mod, je vous conseille de le faire avant de jouer à celui-ci ! Ce jeu est VRAIMENT difficile (de nombreuses personnes n'arrivent pas à passer le premier niveau !)

Dans ce jeu, le code a été modifié, et les niveaux aussi ! Pour m'envoyer votre score et le mettre dans le classement, envoyez-moi un mp avec screen à l'appui de votre temps sur discord à RockingCha1r !

Classement

Varmule : 23.771s

Buradoxe: 84.301s

RockingCha1r : 110.265s

olim0milo: 186.604s


_B=False
_A=True
from kandinsky import*
from ion import*
from time import*
from math import*
backColor=(1,)*3
plateforms_color=0,0,200
not_plateforms_color=30,30,30
death_color=255,0,0
shoot_color=255,100,0
trainee=_B
gunMun=''
gunProps=1
level=0
class Entity:
  def __init__(self,x,y,width,height,speed,ma=_A):self.x=x;self.y=y;self.width=width;self.height=height;self.speed=speed;self.move_alone=ma;self.chute=0;self.gx=self.x+int(self.width/2);self.gy=self.y+self.height;self.dead=_B;self.drawing=[]
  def set_drawing_inverse(self):
    self.drawing_inverse=[None]*len(self.drawing)
    for i in range(len(self.drawing)):j=self.drawing[i];self.drawing_inverse[i]=[self.width-j[0]-j[2],j[1],j[2],j[3],j[4]]
  def contact(self,x1,y1,x2,y2):
    if self.x<=x1<=self.x+self.width or self.x<=x2<=self.x+self.width:
      if self.y<=y1<=self.y+self.height or self.y<=y2<=self.y+self.height:return _A
    return _B
  def step(self):
    x=self.x;y=self.y;self.move()
    if self.x!=x or self.y!=y:fill_rect(x,y,20,30,backColor);self.draw()
  def move(self):
    global level,nv
    if self.chute:
      if self.chute>0:
        if self.tomber():self.y+=self.chute;self.chute+=1
        else:self.y=plateforms[self.get_plateform()][1]-self.height
        if self.y>222:self.dead=_A
      else:self.y+=self.chute;self.chute+=1
    if self.move_alone:
      self.x+=self.speed
      if self.tomber():self.speed*=-1;self.x+=self.speed
    else:
      x=keydown(3)-keydown(0)
      if x:self.speed=abs(self.speed)*x;self.x+=self.speed
      if(keydown(KEY_UP)or keydown(KEY_OK))and not self.tomber():self.y=plateforms[self.get_plateform()][1]-self.height;self.chute=-10
      if not self.tomber():
        if self.contact(points[1][0],points[1][1],points[1][0]+20,points[0][1]+5):level+=1;gunHelp();self.dead=_A
    if self.tomber()and self.chute==0:self.chute=1
  def tomber(self):
    self.gx=self.x+int(self.width/2);self.gy=self.y+self.height
    for i in plateforms:
      if self.gy<=i[1]<=self.gy+self.chute:
        if i[0]<=self.gx<=i[0]+i[2]:return _B
    return _A
  def get_plateform(self):
    if not self.tomber():
      for i in plateforms:
        if self.gy<=i[1]<=self.gy+self.chute:
          if i[0]<=self.gx<=i[0]+i[2]:return plateforms.index(i)
  def draw(self):
    if self.speed<=0:
      for i in self.drawing:fill_rect(self.x+i[0],self.y+i[1],i[2],i[3],i[4])
    else:
      for i in self.drawing_inverse:fill_rect(self.x+i[0],self.y+i[1],i[2],i[3],i[4])
def gunHelp():global gunMun,gunProps;gunMun+=str(round(monotonic()-time_start));gunProps+=1
def draw_all_plateforms(color):
  for i in plateforms:fill_rect(i[0],i[1],i[2],i[3],color)
def draw_all_entities():
  for i in entities:i.move();i.draw()
def death_animation():
  for y in range(11):
    for x in range(16):fill_rect(x*20,y*20,20,24,death_color);sleep(.003)
    if y==5:draw_string('Chute:\n          Die and Recry',140,(y-1)*20,color(0,0,0),color(255,0,0))
  sleep(.01)
points=[]
def draw_all_points():fill_rect(points[0][0],points[0][1]-5,20,5,(255,150,100));fill_rect(points[1][0],points[1][1]-5,20,5,(100,100,255))
maps=[[[[0,212],[270,20]],[[270,132,20,30,2]],[[0,212,100,10],[220,162,100,10],[50,112,50,10],[150,62,2,5],[270,20,20,10]],'The game has barely begun, \n  yet the\n  tapestry of\n  fate reveals its victor.\n\n\n  And it is not you.'],[[[20,20],[260,130]],[[120,110,20,30,5]],[[120,140,70,10],[260,130,20,10]],'    Abandon hope now\n      because only ruin\n      and despair awaits.'],[[[0,200],[280,200]],[[100,170,20,30,-4],[180,170,20,30,-4],[230,170,20,30,-3],[270,170,20,30,3],[310,170,20,30,3]],[[0,200,320,10]],'Turn back now, for ahead lies\n  only frustation and the\n  inevitable taste of defeat\n  in this game.'],[[[0,150],[300,150]],[[0,192,20,30,8],[150,192,20,30,8],[300,192,20,30,-8]],[[100,170,3,3],[250,130,4,4],[0,150,20,5],[300,150,20,5],[0,222,320,1]],'If you believe yourself\n  capable of conquering this\n  endeavor, it reveals not\n  but a profound affliction\n  of ego, a hubris both\n  bold and blind.'],[[[30,30],[130,210]],[],[[138,210,4,2]],'      Pride blinds those who \n        tread where shadows loom.\n        Press exe to succeed.'],[[[0,200],[280,20]],[],[[0,200,20,5],[180,180,3,10],[318,150,2,10],[240,115,5,10],[160,70,5,10],[280,20,20,5]],'The path to\n  triumph is\n  strewn with\n  the bones of\n  the bold.'],[[[10,200],[280,40]],[[250,10,20,30,5],[190,150,20,30,5],[260,100,20,30,5],[120,70,20,30,5],[140,-10,20,30,5]],[[240,40,60,10],[10,200,80,10],[180,180,50,10],[240,130,70,10],[100,100,70,10],[2990,210,20,10],[10,50,60,10],[110,20,90,10]],'\n\n\n\nYou stand\nat the cusp\nof victory.\nGood Luck.'],[[[10,200],[290,200]],[],[[10,200,300,10]],'Against all odds,\n you have prevailed.\n  Congratulations.']]
def enemySecondColor():v2=gunProps + round(monotonic()-time_start);v2+=100;v2=sin(v2)*1000;v=gunMun;return v,v2
def spawn(level):
  global avatar,entities,plateforms,shoot,points,txt,run;fill_rect(0,0,320,222,backColor)
  if level==len(maps):run=_B;return
  map=maps[level];points=map[0];plateforms=map[2];avatar=Entity(points[0][0],points[0][1]-30,20,30,10,_B);avatar.drawing=[(3,0,17,30,(255,0,0)),(0,3,12,10,(200,200,200))];avatar.set_drawing_inverse();entities=[avatar]
  for i in map[1]:
    entities+=[Entity(i[0],i[1],i[2],i[3],i[4])]
    if level!=3:entities[-1].drawing=[(3,0,17,30,(0,255,0)),(0,3,12,10,(200,200,200))]
    else:entities[-1].drawing=[(3,0,17,30,(15,15,15)),(0,3,12,10,(30,30,30))]
    entities[-1].set_drawing_inverse()
  if len(map)==4:draw_string(map[3],20,20,(150,)*3,backColor)
  avatar.draw()
spawn(level)
time_start=monotonic()
run=_A
last_pause=monotonic()-5
paused=0
while run:
  if avatar.dead:death_animation();spawn(level)
  for i in entities:i.step()
  for i in entities[1:]:
    if i.contact(avatar.x,avatar.y,avatar.x+avatar.width,avatar.y+avatar.height):avatar.dead=_A
  draw_all_points()
  if level!=3:draw_all_plateforms(plateforms_color)
  else:draw_all_plateforms(not_plateforms_color)
  if level==4 or level==6:th=1
  else:th=0
  if level==4 or level==6:
    if last_pause+th*2<monotonic():
      if keydown(KEY_EXE):paused=1;last_pause=monotonic()
  if last_pause+th<monotonic():paused=0
  if paused==1:sleep(.2)
  elif level==4:sleep(.003)
  elif level<4 or level==5:sleep(.03)
  else:sleep(.05)
ti,tz=enemySecondColor()
print('ti:',str(ti))
print('tz:',str(tz))
print('Gagne !')
print('Temps:')
print(round(monotonic()-time_start,3),' s')
print('Record : 23.771s par Varmule')

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.