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.


Topics - sebastiend

Pages: [1]
1
General / Key code problem
« on: March 18, 2008, 01:06:02 pm »
I encounter something strange:

Code: [Select]
from PySFML import *
     
if __name__ == "__main__":
    global window
    window = sf.RenderWindow(sf.VideoMode(800, 600, 32), "SFML Window")
    global running
    running = True
    while running == True:
        evt = sf.Event()
        while window.GetEvent(evt):
            if evt.Type == sf.Event.Closed:
                running = False
            if evt.Type == sf.Event.KeyPressed:
                print evt.Key.Code
        window.Display()

This display 51 each time I press a key indepently of the real code.
Could it come from my compilation or system as I use a 64 bits Fedora?

2
General / Clocking
« on: March 11, 2008, 08:37:22 pm »
I get a problem with the clock.

The following code works:

Code: [Select]
from PySFML import *

if __name__ == "__main__":
    clock = sf.Clock()
    print clock.GetElapsedTime()
    clock.Reset()
    while True:
        if clock.GetElapsedTime() >= 10.0:
            print "Tick"
            clock.Reset()


I followed the same scheme into a class making units and a program havind a drawing part but clock looks staying at this value: 1205263872.0

Here is my function:
Code: [Select]
       if self.clock.GetElapsedTime() >= 10 and len(self.buildingQueue) > 0:
            self.parent.addUnit()
            self.buildingQueue.pop(0)
            self.clock.Reset()

Seconds don't seem to matter, the queue is completely proceeded with no delay. The function is called each frame to check if a unit must be created according to the delay.

3
Python / Python
« on: March 07, 2008, 02:09:36 pm »
What is installed with the python package, and where? I did:
Code: [Select]
python setup.py install
It does not reply anything, but there is nothing into both /usr/lib/python2.5/site-packages and /usr/lib64/python2.5/site-packages
Code: [Select]
import sfml doesn't work, of course.

4
Feature requests / Some features
« on: March 06, 2008, 08:24:04 pm »
SFML looks really promising good things for now and the future.

I am currently using the pygame Python library and some features would be interesting if implemented with SFML. I think about sprites groups. It also manage collisions (Only rectangles); so having collisions managed by polygons would not be too much. Having an integrated physics engine or a bridge with an existing one could also improve some games gameplay, even if others may not need it.

Anyway, SDL can render opengl spaces. Still in Pygame, using it make you unable to use both sprite and draw modules. What would be nice is to replace characters sprite animation by a 3d model making it smoother, but still exploring a 2d tilemap like Nintendo has done for both zelda and mario.

Making the first part (sprite groups) could be in my abilities; others, why not with time and good documentation.

Pages: [1]
anything