Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristhofer Travieso <cristhofert97@gmail.com>2013-05-15 01:11:44 (GMT)
committer Cristhofer Travieso <cristhofert97@gmail.com>2013-05-15 01:11:44 (GMT)
commit562e71da944c2dd171d6b4825d3227b8e6722c71 (patch)
tree6fcecfa26d6fc66af6cec54fc6af0b102c9d7228
parent5616954bbaf89f22dea7f1d0d076374bab781701 (diff)
spare values
Signed-off-by: Cristhofer Travieso <cristhofert97@gmail.com>
-rw-r--r--activity.py1
-rw-r--r--game.py29
-rw-r--r--window.py1
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
diff --git a/game.py b/game.py
index 7828674..b08a2be 100644
--- a/game.py
+++ b/game.py
@@ -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()
diff --git a/window.py b/window.py
index 145e0d7..22ca1cd 100644
--- a/window.py
+++ b/window.py
@@ -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