I am not perfect so, even I might need help with *hint*tile-based rpg's*hint*. Please help. Post.

 


Comments

lizards160
10/25/2008 17:41

OK you might want to use a list layout function to get your layouts. These work really well will the sprite class in pygame. here is an example but please try to write your own. this is also best used in a class function. just add the 'self.' and the class function to the variables.

layout=['00000',
'01110',
'01110',
'01110',
'00000']

height=len(layout)
width=len(layout[0])

max_y=height-1

for x in range(self.width):
for y in range(self.height):
char=layout[max_y-y][x]
make_char((x,y),char)

def make_char(point, char):
(x,y)=point
if char=='0':
## this is good for a rpg!!
wall=Wall(x,y)
walls.append(wall)
## or for sprites
walls.add(wall)
if char=='1':
## you might need a floor for a rpg
floor=Floor(x,y)
floors.append(floor)
## or for sprites
floors.add(floor)

And then you use a list update

def update():
for item in walls:
item.update()
for item in floors:
item.update()

i have made a couple games with this function

http://www.mediafire.com/?sharekey=5f463fe95d450ea7ab1eab3e9fa335caba14b48475608c0d

this is a game i made check out the layout function.

BTW i made this a while ago so i didn't know about superclasses. i could cut out a few thousand lines of code that way.

Reply
10/25/2008 17:49

Ok, thanks. I am doing OpenGL now. Either way, it works with c++ and python, not the syntax, but I can make it into c++. I am working on a game called "Tank Attack" in OpenGL. I have not made much of it, and I am working on it with another person. So far, you can move around the screen. You can also toggle between arrow keys or mouse motion. It is going to have a 3-d mode, and a 2-d mode. When they are both finished, we are going to add a title screen to it. Do you do any programming in OpenGL? If you do, would you like to help?

Reply
10/25/2008 17:51

I would also like it if you would make it c++, not python. If you don't know c++, its ok if you do python. Just don't use pygame with it, because I don't have pygame in c++.

Reply



Leave a Reply

    Socool274

    This name started with Runescape, and ever since I've used it everywhere.
     Runescape made me think about game programming, because I knew it was made in Java.