Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://kodomo.cmm.msu.su/trac/snake/changeset/101
Äàòà èçìåíåíèÿ: Unknown
Äàòà èíäåêñèðîâàíèÿ: Sun Apr 10 01:41:11 2016
Êîäèðîâêà: IBM-866
Changeset 101:a5011e14a23d òÀÓ Python Battle

Changeset 101:a5011e14a23d


Ignore:
Timestamp:
12/20/10 03:19:35 (5 years ago)
Author:
Alex Martynov
Branch:
default
Message:

sell.redraw() fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • engine.py

    r100 r101 ˆà
    1717        field_size = min(self.canvas.winfo_height(), self.canvas.winfo_width())ˆà
    1818        offset = (self.canvas.winfo_width() - field_size, self.canvas.winfo_height() - field_size)ˆà
    ˆà19        x0=offset[0] + self.x*field_size/21.0ˆà
    ˆà20        y0=offset[1] + self.y*field_size/21.0ˆà
    ˆà21        x1=offset[0] + (self.x+1)*field_size/21.0ˆà
    ˆà22        y1=offset[1] + (self.y+1)*field_size/21.0ˆà
    ˆà23        x2=offset[0] + (self.x+1/2.0)*field_size/21.0ˆà
    1924        if self.type == 'wall':ˆà
    20ˆà            self.canvas.create_rectangle(offset[0], offset[1], offset[0] + self.x*field_size/21.0, offset[1] + self.y*field_size/21.0, fill="grey")ˆà
    ˆà25            self.canvas.create_rectangle(x0, y0, x1, y1, fill="grey")ˆà
    2126            passˆà
    2227        elif self.type == 'empty':ˆà
    23ˆà            self.canvas.create_rectangle(offset[0], offset[1], offset[0] + self.x*field_size/21.0, offset[1] + self.y*field_size/21.0, fill="black")ˆà
    ˆà28            self.canvas.create_rectangle(x0, y0, x1, y1, fill="black")ˆà
    2429            passˆà
    2530        elif self.type == 'body':ˆà
    26ˆà            self.canvas.create_rectangle(offset[0], offset[1], offset[0] + self.x*field_size/21.0, offset[1] + self.y*field_size/21.0, fill=self.snake.color)ˆà
    ˆà31            self.canvas.create_rectangle(x0, y0, x1, y1, fill=self.snake.color)ˆà
    2732            passˆà
    2833        elif self.type == 'head':ˆà
    29ˆà            self.canvas.create_oval(offset[0], offset[1], offset[0] + self.x*field_size/21.0, offset[1] + self.y*field_size/21.0, fill=self.snake.color)ˆà
    ˆà34            self.canvas.create_oval(x0, y0, x1, y1, fill=self.snake.color)ˆà
    3035            passˆà
    3136        elif self.type == 'tail':ˆà
    32ˆà            self.canvas.create_polygon(offset[0], offset[1], offset[0] + self.x*field_size/21.0, offset[1], offset[0] + self.x*field_size/(2*21.0), offset[1] + self.y*field_size/21.0, fill=self.snake.color)ˆà
    ˆà37            self.canvas.create_polygon(x0, y0, x1, y0, x2, y1, fill=self.snake.color)ˆà
    3338            passˆà
    3439        returnˆà
Note: See TracChangeset for help on using the changeset viewer.