Author |
Message |
tomparis Stooge Three
Joined: 25 Jun 2001 Posts: 5964 Location: At your computer, hacking your files.
|
Wed Sep 12, 2007 11:35 am |
|
Bah! Technical stuff doesn't scare me! Try me!
-------signature-------
tomparis: The artist formerly known as the "Forum Nerd."
99.9% sure I'm not a zombie.
|
|
|
TrekkieMage Office Junkie
Joined: 17 Oct 2004 Posts: 5335 Location: Hiding
|
Wed Sep 12, 2007 2:14 pm |
|
Code: |
class Maze:
def __init__(self):
self.have_window = 0
self.game_over = 0
self.set_layout(the_layout)
def set_layout(self, layout):
height = len(layout)
width = len(layout[0])
self.make_window(width, height)
self.make_map(width, height)
self.movables = []
self.food_count = 0
max_y = height - 1
for x in range(width):
for y in range(height):
char = layout[max_y - y][x]
self.make_object((x, y), char)
for movable in self.movables:
movable.draw()
def make_window(self, width, height):
grid_width = (width-1) * grid_size
grid_height = (height - 1) * grid_size
screen_width = 2*margin + grid_width
screen_height = 2* margin + grid_height
begin_graphics(height = screen_height,
width = screen_width,
title = "PACMAN",
background = background_color)
def to_screen(self, point):
(x, y) = point
x = x*grid_size + margin
y = y*grid_size + margin
return (x, y)
def make_map(self, width, height):
self.width = width
self.height = height
self.map = []
for y in range(height):
new_row = []
for x in range(width):
new_row.append(Nothing())
self.map.append(new_row)
def make_object(self, point, character):
(x, y) = point
if character == '%':
self.map[y][x] = Wall(self, point)
elif character == 'P':
pacman = Pacman(self, point)
self.movables.append(pacman)
elif character == '.':
self.food_count = self.food_count +1
self.map[y][x] = Food(self, point)
elif character == 'G':
ghost = Ghost(self, point)
self.movables.append(ghost)
|
Part of a pacman game written in Python.
I'm just editing the code, I didn't come up with most of it. I need to finish debuggin it and make the bloody thing actually *work*.
|
|
|
squiggy Stooge Two
Joined: 09 Mar 2004 Posts: 3007 Location: Messing with the fabric of Video Game realities. I'll summon Shiva on you! I SWEAR!
|
Wed Sep 12, 2007 2:31 pm |
|
TrekkieMage wrote: | Code: |
class Maze:
def __init__(self):
self.have_window = 0
self.game_over = 0
self.set_layout(the_layout)
def set_layout(self, layout):
height = len(layout)
width = len(layout[0])
self.make_window(width, height)
self.make_map(width, height)
self.movables = []
self.food_count = 0
max_y = height - 1
for x in range(width):
for y in range(height):
char = layout[max_y - y][x]
self.make_object((x, y), char)
for movable in self.movables:
movable.draw()
def make_window(self, width, height):
grid_width = (width-1) * grid_size
grid_height = (height - 1) * grid_size
screen_width = 2*margin + grid_width
screen_height = 2* margin + grid_height
begin_graphics(height = screen_height,
width = screen_width,
title = "PACMAN",
background = background_color)
def to_screen(self, point):
(x, y) = point
x = x*grid_size + margin
y = y*grid_size + margin
return (x, y)
def make_map(self, width, height):
self.width = width
self.height = height
self.map = []
for y in range(height):
new_row = []
for x in range(width):
new_row.append(Nothing())
self.map.append(new_row)
def make_object(self, point, character):
(x, y) = point
if character == '%':
self.map[y][x] = Wall(self, point)
elif character == 'P':
pacman = Pacman(self, point)
self.movables.append(pacman)
elif character == '.':
self.food_count = self.food_count +1
self.map[y][x] = Food(self, point)
elif character == 'G':
ghost = Ghost(self, point)
self.movables.append(ghost)
|
Part of a pacman game written in Python.
I'm just editing the code, I didn't come up with most of it. I need to finish debuggin it and make the bloody thing actually *work*. |
!!!! You know the pacman programming code????
*kneels before the almighty Trekkiemage.*
Gratz on earning Admin powers!!!!!!! You'll be an evil entity before you know it!
Code: | For earning Administrative powers, you grow to Evil Minion levele 30.
You now have access to:
Koopa Troopa((Level 2))
Squiggy((level 27))
and
Mouse Swarm((Re-inforcement power)) |
|
|
|
TrekkieMage Office Junkie
Joined: 17 Oct 2004 Posts: 5335 Location: Hiding
|
Wed Sep 12, 2007 2:37 pm |
|
A little bit of Python and I'm learning Java.
Thanks ^_^
I'm now working on threatening Dan's position as self-proclaimed Jesus of the site
|
|
|
squiggy Stooge Two
Joined: 09 Mar 2004 Posts: 3007 Location: Messing with the fabric of Video Game realities. I'll summon Shiva on you! I SWEAR!
|
Wed Sep 12, 2007 2:38 pm |
|
*Stands at attention and salutes the all-powerful TrekkieMage.*
He doesn't stand a chance.
|
|
|
Valathous The Canadian, eh
Joined: 31 Aug 2002 Posts: 19074 Location: Centre Bell
|
Wed Sep 12, 2007 2:38 pm |
|
I'll smite you. And ooooohhh what a smite it'll be.
|
|
|
TrekkieMage Office Junkie
Joined: 17 Oct 2004 Posts: 5335 Location: Hiding
|
Wed Sep 12, 2007 2:39 pm |
|
It is ON.
|
|
|
squiggy Stooge Two
Joined: 09 Mar 2004 Posts: 3007 Location: Messing with the fabric of Video Game realities. I'll summon Shiva on you! I SWEAR!
|
Wed Sep 12, 2007 2:40 pm |
|
*hides behind Trekkiemage*
Don't hurt me!!
|
|
|
Valathous The Canadian, eh
Joined: 31 Aug 2002 Posts: 19074 Location: Centre Bell
|
Wed Sep 12, 2007 2:54 pm |
|
You know, that's not a very good hiding place,
|
|
|
TrekkieMage Office Junkie
Joined: 17 Oct 2004 Posts: 5335 Location: Hiding
|
Wed Sep 12, 2007 4:26 pm |
|
orly?
We'll just see about that
|
|
|
Theresa Lux Mihi Deus
Joined: 17 Jun 2001 Posts: 27256 Location: United States of America
|
Sun Sep 16, 2007 4:41 pm |
|
Congratulations on being admin! Now you have all of those "powers",
(sorry, tried to post before, but my comp is being a complete ass. I think it's male)
|
|
|
TrekkieMage Office Junkie
Joined: 17 Oct 2004 Posts: 5335 Location: Hiding
|
Sun Sep 16, 2007 9:59 pm |
|
Theresa wrote: | Congratulations on being admin! Now you have all of those "powers",
(sorry, tried to post before, but my comp is being a complete ass. I think it's male) |
Thank you!
My suite-mate is a member of STV and said I could play with his account
As for the computer, must be
|
|
|
squiggy Stooge Two
Joined: 09 Mar 2004 Posts: 3007 Location: Messing with the fabric of Video Game realities. I'll summon Shiva on you! I SWEAR!
|
Thu Oct 11, 2007 6:31 pm |
|
You have an evil minion who wishes to join your' party, cancel or allow?
lol, sorry, I had fun with that. XD
Last edited by squiggy on Fri Oct 12, 2007 12:09 am; edited 1 time in total
|
|
|
TrekkieMage Office Junkie
Joined: 17 Oct 2004 Posts: 5335 Location: Hiding
|
Thu Oct 11, 2007 9:25 pm |
|
lol
That question mark by your clothes may be an issue
|
|
|
squiggy Stooge Two
Joined: 09 Mar 2004 Posts: 3007 Location: Messing with the fabric of Video Game realities. I'll summon Shiva on you! I SWEAR!
|
Thu Oct 11, 2007 10:38 pm |
|
I have bad taste in clothing.
It's very evil of me, you know. Making other people's eyes hurt.
Put the question mark there because I didn't want to scare people
|
|
|
TrekkieMage Office Junkie
Joined: 17 Oct 2004 Posts: 5335 Location: Hiding
|
Thu Oct 11, 2007 11:28 pm |
|
Trust me, the question mark is just as scary!
|
|
|
squiggy Stooge Two
Joined: 09 Mar 2004 Posts: 3007 Location: Messing with the fabric of Video Game realities. I'll summon Shiva on you! I SWEAR!
|
Thu Oct 11, 2007 11:41 pm |
|
haha. Awesome!
How delightfully evil. ^^
However, to be polite, I'll change it for ya:
|
|
|
TrekkieMage Office Junkie
Joined: 17 Oct 2004 Posts: 5335 Location: Hiding
|
Fri Oct 12, 2007 12:08 pm |
|
Thank you, much less terrifying ^-^
|
|
|
squiggy Stooge Two
Joined: 09 Mar 2004 Posts: 3007 Location: Messing with the fabric of Video Game realities. I'll summon Shiva on you! I SWEAR!
|
Fri Oct 12, 2007 12:50 pm |
|
lol, anything to keep the evil lady happy.
XD
|
|
|
Valathous The Canadian, eh
Joined: 31 Aug 2002 Posts: 19074 Location: Centre Bell
|
Mon Oct 15, 2007 4:10 pm |
|
*poke*
Gotcha!
|
|
|
TrekkieMage Office Junkie
Joined: 17 Oct 2004 Posts: 5335 Location: Hiding
|
Mon Oct 15, 2007 4:45 pm |
|
We'll see about that
|
|
|
squiggy Stooge Two
Joined: 09 Mar 2004 Posts: 3007 Location: Messing with the fabric of Video Game realities. I'll summon Shiva on you! I SWEAR!
|
Mon Oct 15, 2007 5:15 pm |
|
*salutes trekkie mage.*
Ma'am, yes ma'am!
*spikes Valathous's Molson Canadian with Cyanide, and a little bit of rat poison for good measure.*
|
|
|
Valathous The Canadian, eh
Joined: 31 Aug 2002 Posts: 19074 Location: Centre Bell
|
Mon Oct 15, 2007 6:20 pm |
|
... No true Canadian would ruin another man's beer. Try putting it in my food if you must, but my Molson Canadian? You've let me down, squig,
|
|
|
squiggy Stooge Two
Joined: 09 Mar 2004 Posts: 3007 Location: Messing with the fabric of Video Game realities. I'll summon Shiva on you! I SWEAR!
|
Mon Oct 15, 2007 7:23 pm |
|
I AM an evil minion after all; Just doing as I'm told.
Besides, I know that, Canadian to Canadian, no true canadian would turn down a beer
even if it WAS poisoned.
|
|
|
TrekkieMage Office Junkie
Joined: 17 Oct 2004 Posts: 5335 Location: Hiding
|
Mon Oct 15, 2007 10:45 pm |
|
I did no such thing! Squiggy, are you listening to those voices again? Remember what happened when you tried to assasinate your toaster?
Val, next time I'm in Canadia I'll buy you another beer
|
|
|
|