Zvisinei Nyamweda | 25 Jun 21:04 2015
Picon

Creating a playlist with pyglet

cant figure out how to create a playlist.... can anyone please help

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Rob | 20 Jun 13:37 2015
Picon

Pyglet 1.3

Hi all,

Now that 1.2.3 is released, I hope most critical bugs in 1.2 are resolved. From now on I will be focussing on pyglet 1.3 only. Of course if a really critical bug is revealed in 1.2.3 I will make a new bug-fix release.

For 1.3 I am following this roadmap: https://bitbucket.org/pyglet/pyglet/wiki/Roadmap. Please let me know if you think something essential is missing. Also please vote on the issues at https://bitbucket.org/pyglet/pyglet/issues?status=new&status=open. That will help prioritizing the issues to fix for 1.3.

If you have any useful feature or bug-fix, do not hesitate to create a pull request. I can use all the help I can get ;-).

Kind regards,
Rob

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Rob | 20 Jun 11:27 2015
Picon

Pyglet 1.2.3

Hi all,

I did not receive any blocking issues on version 1.2.3b1, so I just uploaded pyglet 1.2.3 to PyPI.

Release notes: https://bitbucket.org/pyglet/pyglet/src/803e15c9457e41c7c0bef10ba6f6c921950aa584/RELEASE_NOTES?at=pyglet-1.2-maintenance
Downloads: https://bitbucket.org/pyglet/pyglet/downloads
PyPI: https://pypi.python.org/pypi/pyglet
Documentation: http://pyglet.readthedocs.org/en/pyglet-1.2-maintenance/index.html

Kind regards,
Rob

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
NiBE | 16 Jun 21:07 2015
Picon

Scrolling big sprite in background


HI,
I'm trying to convert a simple game written in pygame in pyglet. I almost figure out everything, but now I'm facing this situation, I have a background sprite like this example:


In my pygame code I use to write this to let it scrolls smoothly in the background:


base_shift = self.graphic.IMAGES['base'].get_width() - self.COMMON_CONST['screenWidth']
while True:
    base_x
= -((-base_x + 3) % base_shift)
   
self.screen.blit(self.graphic.IMAGES['base'], (base_x, y))

Basically the image is longer than the actual screen and once it passes the delta value between image X and screen X, the image is set to 0 again.


I'm trying to do the same in pyglet inside the def update(self, dt): function but I have no idea exactly how to do it.

I mean I understand the meaning of dt but still I can't get it.

To move the image now I do something like this:


def update(self, dt):
   
self.base.x -= 30 * dt

Of course this will continue to move and it does not reset his position. How can I replicate the behavior that I have done in pygame?

I'm sorry maybe this is a stupid question, I'm a newbie trying to learn.


thanks a lot





--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Brandon Keith Biggs | 4 Jun 22:42 2015
Picon

pyglet website?

Hello,
pyglet.org
seems to only take me to the bitbucket page. Is this what is supposed to happen?
thanks,

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Melis Cakar | 4 Jun 20:32 2015
Picon

AVbin Installation failed

Hi,


I am trying to download AVbin to our lab computers(Mac Version 10.10.2), and AVbin gives an error at the end of installation saying :


--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Chris Chan | 3 Jun 21:02 2015
Picon

Official Reposirtory Location ?

Hi, 

I'm using Pyglet for a project, and was wondering where the 'official' repo is now located...is the one at Google Code defunct ? 

Chris

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Mark Weyland | 1 Jun 11:20 2015
Picon

Tutorials and documentation are gone!

I get redirected to https://bitbucket.org/pyglet/pyglet/wiki/Home everytime and that repository is empty! Where can I find tutorials and documentation again?

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Rob | 30 May 15:56 2015
Picon

pyglet 1.2.3b1

Hi all,

I just uploaded pyglet 1.2.3b1. If no weird stuff (or blocking issues) shows up I will release this version next week as 1.2.3. So for anybody who has some spare time, please give it a try and see if it works on your platform and with your projects.

Release notes:

Pyglet 1.2.3                                                                                        
============                                                                                        
Minor bugfix release.                                                                               
                                                                                                    
Bugfixes:                                                                                           
- Windows: Fix issue where ALT key causes app to hang.                                              
- Media: Many fixes to PulseAudio and OpenAL media drivers (a.o. #26, #27).                         
- OSX: Fix stealing the menu when already present in cocoa.                                         
- Fix multi texturing support (#28).                                                                
- OSX: Prevent segfault with multiple runs (#37/GC728)                                              
- ArchLinux: Fix segmentation fault when using gdk_pixbuf (#25)  

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Salvakiya | 29 May 09:21 2015
Picon

event scheduler and animations

I have run into an issue with the way pyglet handles animations. I want to manually handle which frame of the animation my sprite is on rather than having the animation schedule an event for me. I have found that when you have many animated images on the screen it lags the game because they are all scheduling events.

I will be loading the graphics from sprite strips.

I need a way to get how many images are in the animation
I need a way to set which image to display


How difficult would this be to overhaul? I want to manually animate my sprites in the game loop rather than making a ton of scheduled requests.


if there is a better way let me know.

thanks

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
PirlKnighte | 25 May 19:40 2015
Picon

Pyglet and Sockets

I'm running into a problem where it won't send data while pyglet.app is running, even when added as a schedule_interval.  After I close the window it seems to read that data was sent.  Here is my code:

Sever.py
#!usr/bin/python

import socket, thread, time, json

currentUsers
= {}
collidables
= json.loads(json.dumps(""))
map_size
= 100
maxPlayers
= 50
current_IP
= socket.gethostbyname(socket.gethostname())

def Timer():
       
global waiting
       
while True:
                waiting
= False
                time
.sleep(0.05)
               
print "-"
                waiting
= True
                time
.sleep(0.1)

def Admin():
       
print "Creating Admin port %s" % str(4999)
        s
= socket.socket(socket.AF_INET, socket.SOCK_STREAM) # create new socket
        s
.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,1) # set to reusable
        s
.bind(('',4999)) # bind said socket
        s
.listen(1)
        client
, address = s.accept() # wait for new connection
       
while True:
                data
= client.recv(size)
               
if data == "/UserList":
                        client
.sendall(str(currentUsers))
                       
print currentUsers

def Thread(port):
       
global host, size, nextPort, waiting, maxPlayers
       
print "\r                                                                       \rCreating User ports %d/%d" % (port-5000, maxPlayers),
       
while True:
               
try:

                       
# Create socket and wait for connection
                        s
= socket.socket(socket.AF_INET, socket.SOCK_STREAM) # create new socket
                        s
.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,1) # set to reusable
                        s
.bind(('',port)) # bind said socket
                        s
.listen(1)
                        client
, address = s.accept() # wait for new connection
                        username
= client.recv(100)
                       
print "Port %s connected to \"%s\" %s" % (str(port), username, str(address))
                        currentUsers
[str(port)] = str(address) + " | " + username
                        client
.sendall(str(map_size))

                       
# Main loop, adds point to hashmap
                       
while True:
                                data
= client.recv(size)
                               
print data+"+"
                               
while waiting:
                                       
pass
                               
if data:
                                       
# print "Recieved from port  %s (%s)" % (port, str(address[1]))
                                        data_json
= json.loads(json.dumps(data))
                                        collidables
.append(data_json)
                                        client
.sendall(str(collidables))
                                       
print collidables+"."
                               
while not(waiting):
                                       
pass

                        client
.close()
                        s
.close()
                       
break
               
except socket.error:           # Add something to check for timeouts \ Quitters
                       
print "\"%s\" in port %s left %s" % (username,str(port),str(address))
                        client
.close()
                        s
.close()

               
except:
                       
print "\nFailed to Create port %s" % str(port)
                        client
.close()
                        s
.close()
                        time
.sleep(1)
                        nextPort
-=1
                       
NeedNewThread = True
                       
break


host
= 'localhost'
nextPort
= 5000
size
= 1000000
hashMap
= {}
waiting
= True
print current_IP
thread
.start_new_thread(Admin,())
thread
.start_new_thread(Timer,())
time
.sleep(0.5)

while nextPort < 5000+maxPlayers+1:
        thread
.start_new_thread(Thread,(nextPort,))
        time
.sleep(0.1)
        nextPort
+=1
print ""

while True:
       
pass




Client.py
from pyglet.window import Window,key
from pyglet import app
from pyglet.text import Label
from pyglet.clock import schedule_interval
import random, socket



Keys = [False,False,False,False,False] # [W,A,S,D,FIRE]
last = Keys

bullets
= []
bullet_speed
= 3
bullet_life
= 5


point
= {'x':0,'y':0}
size
= 100 # query server for size
map_size
=10

username
= "Lemonilla"


# Game Setup
print "Enter IP of the server you with to connect to."
server_IP
= raw_input(">")

port
= None
while port == None:
       
for x in xrange(0,50):
               
try:
                       
print "\r                                    \r  Attempting socket %d" % (5000+x),
                        server
= socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                        server
.connect((server_IP,5000+x))
                        port
= 5000+x
                       
break
               
except:
                       
pass

server
.sendall(username)
print "\n  Waiting for server to respond. . ."
size
= server.recv(10)
print   "  Launching Game. . ."

win
= Window()
ScreenMap = Label("")


def move():
       
global Keys,point,last
       
if Keys[0] == True: # W
                point
['y']+=1
       
if Keys[1] == True: # A
                point
['x']-=1
       
if Keys[2] == True: # S
                point
['y']-=1
       
if Keys[3] == True: # D
                point
['x']+=1
       
if Keys[4] == True: # SPACE
               
Fire()
       
last = Keys

def Fire():
       
global last
       
# bullet = [x, y, distance to travel, direction]
                                       
#     (W, A, S, D, FIRE)
        bullets
.append((point['x'], point['y'], bullet_life, list(last)))

def decay():
       
global bullets
        index
=0
       
for b in bullets:
                bullet_x
=b[0]
                bullet_y
=b[1]

               
if b[3][0] == True:
                        bullet_y
=b[1]+bullet_speed
               
if b[3][2] == True:
                        bullet_y
=b[1]-bullet_speed
               
if b[3][1] == True:
                        bullet_x
=b[0]-bullet_speed
               
if b[3][3] == True:
                        bullet_x
=b[0]+bullet_speed
               
if b[2]-1 > 0:
                        bullets
[index] = (bullet_x, bullet_y, b[2]-1, b[3])
               
else:
                        bullets
[index] = None
                index
+=1
       
while bullets.count(None) > 0:
                bullets
.remove(None)

def check_crash():
       
return
        send
= "{\'"+str(username)+"\':"+str(bullets)+"}"
        server
.sendall(send)
       
print send
       
# Query Server for Colidables list
        collidables
= server.recv(1000000)
       
print collidables

def buildScreen():
       
global ScreenMap, win, point, map_size
        screen
= ""
       
for y in xrange(point['y']+map_size+1,point['y']-map_size,-1):
               
for x in xrange(point['x']-map_size-1,point['x']+map_size):
                       
if not(x == point['x'] and y == point['y']):
                                printed
= False
                               
for b in bullets:
                                       
if x == b[0] and y == b[1]:
                                               
if not(printed):
                                                        screen
+="  +"
                                                        printed
= True
                               
if not(printed):
                                        screen
+="  . "
                       
else:
                                screen
+=" <at> "
                screen
+="\n"
       
ScreenMap = Label(str(screen), x=0, y=win.height, width=win.width, multiline=True)


<at> win.event
def on_key_press(symbol, modifiers):
       
global Keys,ScreenMap
       
if symbol == key.A:
               
Keys[1] = True
       
if symbol == key.S:
               
Keys[2] = True
       
if symbol == key.W:
               
Keys[0] = True
       
if symbol == key.D:
               
Keys[3] = True
       
if symbol == key.SPACE:
               
Keys[4] = True
        win
.clear()
       
ScreenMap.draw()

<at> win.event
def on_key_release(symbol, modifiers):
       
global Keys,ScreenMap
       
if symbol == key.A:
               
Keys[1] = False
       
if symbol == key.S:
               
Keys[2] = False
       
if symbol == key.W:
               
Keys[0] = False
       
if symbol == key.D:
               
Keys[3] = False
       
if symbol == key.SPACE:
               
Keys[4] = False
        win
.clear()
       
ScreenMap.draw()
       


def update(dt):
       
global Keys,ScreenMap,point

        buildScreen
()
        move
()
        decay
()
        check_crash
()

        win
.clear()
       
ScreenMap.draw()

        point_label
= Label("%d,%d" % (point['x'],point['y']))
        point_label
.draw()
 

schedule_interval
(update, 0.1)

app
.run()




--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Gmane