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

Author Topic: Back and working on restoring pysfml  (Read 11021 times)

0 Members and 1 Guest are viewing this topic.

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
Back and working on restoring pysfml
« on: June 19, 2019, 09:43:07 am »
After nearly 7 years of silence, I'm back :)

And I'll work on restoring pysfml since I now use mainly this fantastic language !
Mindiell
----

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
Re: Back and working on restoring pysfml
« Reply #1 on: June 21, 2019, 10:35:11 pm »
I did get the sources from github and pushed a new repo there :
https://framagit.org/Mindiell/python-sfml

I modified source code in order to include PRs from github too.

Now I'll work on a little "how to" in order to let anyone build it, and later I'll focus on next versions of SFML
Mindiell
----

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Back and working on restoring pysfml
« Reply #2 on: June 21, 2019, 10:37:40 pm »
Nice, thanks  :)
Laurent Gomila - SFML developer

logo123

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Back and working on restoring pysfml
« Reply #3 on: July 10, 2019, 07:31:58 pm »
i have been work with pyglet about some years...

pymunk+pyglet is a good idea... ...   but when your game have more than 200
dynamic sprites which move with pymunk, pyglet will get a little even too much slow......   so i have been going to find a faster python's game engine

def testSpriteUpdate():
    t1=time.clock()
    for body in logols:
        sprite.rotation = math.degrees(body.angle)
        #sprite.rotation = body.angle
        sprite.position=body.position
        #sprite.set_position(*body.position) #slower than sprite.position=x.x
        #a=math.degrees(body.angle)
        #b=body.angle   #cost time without the #lines....
        #sprite.x,sprite.y=body.position
    t2=time.clock()
    print len(logols),t2-t1

logols is a list with 200 pymunk's body... ...
it will take about 0.012s ..... ...with nuitka pyglet's sprite.py to sprite.pyd ,it will still cost 0.009s in my computer  it will be hard to keep frames in 100 when there are more than 200 sprites or animation on a same screen


but... ...when i tried out pysfml about 1.5 day , it is quick a lot than pyglet... ...

pymunk+pysfml is better than pymunk+pyglet.... (i dont want the pygame it is not so pythonic)

a small tip is that rotated sprite in pysfml... ...set texture.smooth=True, it will be beautiful as same as pyglet

pysfml is soooo good to use.... python and c++ speed... ...

pyglet has a animation class, and pysfml can get one by myself etc...

:)

pyglet and pysfml is similar,,,, and pysfml is a lot faster than pyglet in many sections....
pyglet is pure python code... ...

pyglet has a batch.draw .... a lot of sprite can be added to a batch...
but when the sprites come from different image it still cost more time than for i in spritelist: window.draw(i) with pysfml...  pysfml is a lot faster than pyglet when sprites with different textures

when lots of sprites come from a same image... batch.draw can faster a  lot than pysfml's draw i for i in list...

.... ....

pysfml is great... ...






« Last Edit: July 11, 2019, 04:04:59 am by logo123 »