diff options
author | Cristhofer Travieso <cristhofert97@gmail.com> | 2013-05-15 01:11:44 (GMT) |
---|---|---|
committer | Cristhofer Travieso <cristhofert97@gmail.com> | 2013-05-15 01:11:44 (GMT) |
commit | 562e71da944c2dd171d6b4825d3227b8e6722c71 (patch) | |
tree | 6fcecfa26d6fc66af6cec54fc6af0b102c9d7228 | |
parent | 5616954bbaf89f22dea7f1d0d076374bab781701 (diff) |
spare values
Signed-off-by: Cristhofer Travieso <cristhofert97@gmail.com>
-rw-r--r-- | activity.py | 1 | ||||
-rw-r--r-- | game.py | 29 | ||||
-rw-r--r-- | window.py | 1 |
3 files changed, 14 insertions, 17 deletions
diff --git a/activity.py b/activity.py index 25bc282..f65ca33 100644 --- a/activity.py +++ b/activity.py @@ -1,5 +1,4 @@ # Copyright (C) 2012 Cristhofer Travieso <cristhofert97@gmail.com> -# Copyright (C) 2012 Agustin Zubiaga <aguz@sugarlabs.org> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1,6 +1,5 @@ #!/usr/bin/env python -# Copyright (C) 2012 Agustin Zubiaga <aguz@sugarlabs.org> # Copyright (C) 2012 Cristhofer Travieso <cristhofert97@gmail.com> # This program is free software; you can redistribute it and/or modify @@ -36,12 +35,13 @@ LINE_WIDTH = 12 BACKGROUND_COLOR = (0, 1, 0) + class Canvas(Gtk.DrawingArea): def __init__(self): GObject.GObject.__init__(self) self.cars = [] - self.routes = [] + self.routes = [(10, 50)] self.connect('draw', self._draw_cb) @@ -49,23 +49,22 @@ class Canvas(Gtk.DrawingArea): def _draw_cb(self, widget, context): self.alloc = self.get_allocation() - self.context = context # Background - self.context.rectangle(0, 0, self.alloc.width, self.alloc.height) - self.context.set_source_rgb(*BACKGROUND_COLOR) - self.context.fill() - + context.rectangle(0, 0, self.alloc.width, self.alloc.height) + context.set_source_rgb(*BACKGROUND_COLOR) + context.fill() + #Draw route for route in self.routes: - route = x, y, w, h - self.context.rectangle(x, y, w, h) - self.context.set_source_rgb(0, 0, 1) - self.context.fill() + x, w = route + context.rectangle(x, 0, w, self.alloc.height) + context.set_source_rgb(0.2, 0.2, 0.2) + context.fill() #Draw cars for car in self.cars: - car = x, y, w, h - self.context.rectangle(x, y, w, h) - self.context.set_source_rgb(0, 0, 1) - self.context.fill() + x, y, w, h = car + context.rectangle(x, y, w, h) + context.set_source_rgb(0, 0, 1) + context.fill() @@ -1,6 +1,5 @@ #!/usr/bin/env python -# Copyright (C) 2012 Agustin Zubiaga <aguz@sugarlabs.org> # Copyright (C) 2012 Cristhofer Travieso <cristhofert97@gmail.com> # This program is free software; you can redistribute it and/or modify |