Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - maoam

Pages: [1]
1
Python / Re: Saving sprites in a list
« on: July 01, 2013, 01:02:16 pm »
Ahh, I understand. Thanks for the help, it works now

2
Python / [Solved] Saving sprites in a list
« on: June 30, 2013, 08:17:48 pm »
I'm new to python and I'm trying to make a list of sprites, all with the same texture but with different positions. I try and append the sprites with new positions onto my list, but all the sprites in the list end up having the same position. Any help?

def stageLoader():
    try:
        texture = sf.Texture.from_file("Brown Block.png")
    except:
        exit(1)
    tileSprite = sf.Sprite(texture)
    spriteMap = []

    for xtile in range(8):
        for ytile in range(4):
            tileSprite.position = (xtile*100, ytile*170)
            spriteMap.append(tileSprite)
    return spriteMap

stageMap = stageLoader()
for tile in range(len(stageMap)):
        print(stageMap[tile].position)
 

My output is this:
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y
700.0x, 510.0y

3
Graphics / Organising large tilemaps
« on: May 27, 2012, 01:08:06 am »
Hi, I've been having a problem on organising a tile based game

Lets say I load a tilesheet with around 10 tiles, then I use subrect to separate this tilesheet into separate tiles, which will be numbered from 1 to 10.

For small maps I create a two-dimensional array, where each element of the array can have a number from one to ten which represents a particular tile; it is then easy to draw a small map as the number of elements in this array is small and I can just fill in this array manually with a number from 1-10 that I choose.

For large maps (large multid-array), is there an easy/automatic way of getting the numbers that would be stored into this array using the same tilesheet as above? I was thinking of using a tilemap editor, but I dont really understand what it exports, does it export a list of numbers/labels that can correspond to the same tilesheet that I mentioned above?

Pages: [1]