Re: [pygame] Can the pygame infrastructure be used for non-graphical text-mode games?

2020-06-17 Thread Noel Garwick
What Ian said is totally valid.

But maybe you're wanting something like this pseudo curses implementation
in pygame..?

https://inventwithpython.com/pygcurse/

On Wed, Jun 17, 2020, 11:16 PM Ian Mallett  wrote:

> This is a puzzling question to me since it's not clear what one expects.
> Pygame is, after all, the Python wrapper around SDL—the Simple DirectMedia
> Layer. In a text-based game, you don't really have media, so it's not
> really clear to me what you'd expect pygame to do for you? By definition,
> you wouldn't be blitting images or getting input from a graphics window,
> which are the main features of pygame. Stuff like font rasterization, color
> conversion, masking, etc. are handled for you in a terminal. I guess you
> could use pygame to play music and sounds.
>
> One could also write a *graphics-based* program that *looks like* a
> terminal but *isn't*, and write a "text-based" game that way. Pygame
> would be a good choice for this, but the broader choice of reinventing the
> terminal would probably be a bad choice (for being a waste of time).
>
> Ian
>


Re: [pygame] Delay in MOUSEBUTTONUP after application start

2017-11-19 Thread Noel Garwick
If you tie it to something other than a print statement, are you still
seeing a delay?

And maybe this is a dumb question, but are you using the same mouse when
you test on Windows and OSX? Just to rule out anything physically different
with the mouse...

On Sun, Nov 19, 2017 at 11:29 PM, Irv Kalb  wrote:

>
> On Nov 18, 2017, at 11:28 PM, Ian Mallett  wrote:
>
> ​Hi,
>
> FWIW I am unable to reproduce on Win 7 Pro, Py 3.5.1, PyGame 1.9.2a0 (to
> print the latter, `print(pygame.ver)`).
>
> The event system, like everything else, is really just a thin layer over
> SDL's—so for platform-specific issues in PyGame it's commonly the
> underlying SDL that's at fault. Notwithstanding that SDL is fairly
> well-tested, but Mac tends to be a lower priority for testing, on account
> of Apple making game development on OS X difficult in a variety of ways. My
> *guess* is that it's a minor hiccup in older SDL on MacOS that no one
> ever noticed before, additionally because MOUSEBUTTONUP is often ignored—in
> which case you're most likely to get closure from the SDL community, unless
> someone here feels like C spelunking.
>
> Maybe `pygame.event.clear()` would trick the event system into behaving
> better on startup?
>
> Ian
>
>
>
> Thanks for the suggestion.  I did try adding a call to event.clear() after
> my for loop where I check for events, but there was no change.  I also
> tried event.pump(), and I'm still seeing the delay.
>
> And thanks for letting me know how to check the version of pygmae.  I am
> running 1.9.3
>
> I also checked in on my Windows system, and I cannot reproduce it there
> either.
>
> One other thing I just found out.  Even if I start the program running (on
> my Mac), and wait for a while before the first click, (maybe 2 to 3
> seconds), again the first click goes through just fine, but the second
> click shows the MOUSEBUTTONDOWN right away, but the matching MOUSEBUTTONUP
> still delays from 1 to 3 seconds.  Definitely strange.
>
> Irv
>
>


Re: [pygame] Re: Pygame doesn't close properly so I can't delete the file it's using

2017-05-28 Thread Noel Garwick
Could you post the source somewhere?

I think another reason those files are staying locked could be if you
aren't calling filename.close()

On May 28, 2017 4:19 AM, "Gameskiller01"  wrote:

> It already does.
>
>
>
> --
> View this message in context: http://pygame-users.25799.x6.
> nabble.com/Pygame-doesn-t-close-properly-so-I-can-t-
> delete-the-file-it-s-using-tp3044p3046.html
> Sent from the pygame-users mailing list archive at Nabble.com.
>


Re: [pygame] Blit method bug?

2017-05-25 Thread Noel Garwick
Hi babaliaris,

Glad to see you're trying out pygame.  Just a suggestion, but even though
you can see the code in the video, it's still a good idea to paste or
provide a link to it in your email.

This is something I've encountered before. It doesn't really have anything
to do with the number of images you're blitting (only a very small
percentage of those are even being written to the screen, see?) It's a
limitation due to the coordinates being 16-bit integers.  When those go
past  32,767 (for signed, which allow negative and positive values), it
starts back at -32,767 and continues until we hit positive values you would
see on the screen.  Since those are starting at an odd number, you end up
with the 'offset' images you see in your output.

Python 3 supports much larger numbers.  iirc, the default for an integer is
as much as a full Long -- so it should match the maximum allowable value
for your environment.  Pygame is still using 16-bit integers for blitting,
though.  One thing to remember is that all of those very large values are
wa outside the coordinates you are actually using in your display
600x600 window.  Anyway, you will want to do something like storing the
absolute location of an object and also the location (rect) of a 'camera'.
Then you can do a calculation to find where you should display the object
(if at all) by finding out where it is in relation to your camera rect.  I
usually keep track of 2 rectangles per object; a hrect (as in "hit" rect)
for absolute value / collisions, and a rect that is its location in
relation to the camera (and named 'rect' so it will be used by the sprite
group's draw method). Something like..

class Thing(pygame.sprite.Sprite):
def __init__(self, x, y):
self.x, self.y = x, y
self.image = pygame.image.load("dude.png")
self.rect = self.image.get_rect()

self.hrect = self.rect.copy()

self.hrect.topleft = self.x, self.y
...
def update(self, camera):
# logic to update self.x and self.y goes here

self.hrect.topleft = self.x, self.y
self.rect.topleft = self.x - camera.x, self.y - camera.y



Hope that helps.

On Thu, May 25, 2017 at 7:06 AM, babaliaris 
wrote:

> Hello!
>
> i have a problem with blit. When i try to blit a lot of images using a for
> loop (for example 800) after a certain amount, the blit is messing up the
> drawing.
>
> See the following video i made:  Blit Problem Video
> 
>
> You can clearly see all my code in the video.
>
> Can anyone tell me if this is a bug or if not, what is the problem?
>
> Thank you.
>
>
>
> --
> View this message in context: http://pygame-users.25799.x6.
> nabble.com/Blit-method-bug-tp3039.html
> Sent from the pygame-users mailing list archive at Nabble.com.
>


Re: [pygame] PYGAME 2.0

2016-04-13 Thread Noel Garwick
lol, good point.  But I think that's what the SDL2 re-implementation of
pygame is supposed to be, right?

You can check out ren/pytom's github here..
https://github.com/renpy/pygame_sdl2

On Wed, Apr 13, 2016 at 12:53 AM, DiliupG  wrote:

> Since it's beginnings in 2000 isn't it time that we had Pygame 2 or do we
> wait till 2020 for that(so that version 2 comes 20 years later, like some
> kind of symmetry) ? Rene, I would like you to respond please..
>
> --
> Diliup Gabadamudalige
>
> http://www.diliupg.com
> http://soft.diliupg.com/
>
>
> **
> This e-mail is confidential. It may also be legally privileged. If you are
> not the intended recipient or have received it in error, please delete it
> and all copies from your system and notify the sender immediately by return
> e-mail. Any unauthorized reading, reproducing, printing or further
> dissemination of this e-mail or its contents is strictly prohibited and may
> be unlawful. Internet communications cannot be guaranteed to be timely,
> secure, error or virus-free. The sender does not accept liability for any
> errors or omissions.
>
> **
>
>


Re: [pygame] Receiving stack overflow when inheriting Sprite class

2015-10-12 Thread Noel Garwick
Take the call out;

__author__ = 'User'
import pygame
class Box(pygame.sprite.Sprite):
def __init__(self,scn):
pygame.sprite.Sprite.__init__(self)
self.scn = scn
self.image =pygame.image.load('assets\cube.png').convert_alpha()
self.rect = self.image.get_rect()
self.rect.left = scn.width / 2 - self.rect.width/2
self.rect.top= scn.height /2  - self.rect.hight /2
self.speed = 4
self.scn.box_group.add(self)


def event_received(self):
 if self.scn.key_pressed == 'left':
 if self.rect.left >0:
 self.rect.left -=self.speed
 elif self.scn.key_pressed == 'right':
 if  self.rect.right 0:
 self.rect.top -= self.speed
 elif self.scn.key_pressed == 'down':
 if self.rect.bottom < self.scn.height:
 self.rect.top +=self.speed
def update(self):
self.event_received()

On Mon, Oct 12, 2015 at 5:00 PM, Tom Easterbrook  wrote:

> Hey everybody,
>
> I am currently having an error in the latest build where inheriting the
> Sprite class Causes a stack overflow error as pictured below:
>
> I have narrowed this error down to the Loop in the Sprite class Which is
> present between lines 136 to 140. I've included an image of the Loop for
> reference
>
> Finally I have included a copy of my Class In case that helps anybody
>
> Any help Would be appreciated!
>
> --
> Regards,
>
> Tom Easterbrook
>
> This email and any attachments to it may be confidential and are intended
> solely for the use of the individual to whom it is addressed. Any views or
> opinions expressed are solely those of the author and do not necessarily
> represent those of any other person or organisation
>
> If you are not the intended recipient of this email, you must neither take
> any action based upon its contents, nor copy or show it to anyone.
>
> Please contact the sender if you believe you have received this email in
> error.
>


Re: [pygame] Function for keyboard movement

2015-10-06 Thread Noel Garwick
Hi Bob,

There are a lot of ways to do it..

In the past, I've used something like this for teaching basic movement:


   - Store time since previous frame
   - Poll for events
  - Update held keys
   - If movement key held,
  - set movement/direction flag for player sprite
   - Update sprite ai based on time since previous frame
  - if movement/direction flag on
 - generate a rect for the proposed new location
 - see if the new location only includes non-blocked tiles
 (background collision)
- If it doesn't, this is our sprite's new rect
- If it does, either
   - do nothing (very basic) or
   - move to the edge of the original position

This should work fine for objects that won't move fast enough to cover more
than a tile per frame..

Is that what you were looking for?  Or something even more abstracted like..

while True:
tts = fpcClock.tick( FPS )

held_keys = update_keys()

draw_background()

update_sprites( tts, held_keys )

draw_sprites()

pygame.display.update()

Thank you,
Noel

On Tue, Oct 6, 2015 at 4:12 PM, Bob Irving  wrote:

> Hi folks,
>
> We're introducing Python for 9th grade this year and moving from Blitz
> Basic for game programming. Just wondering if anyone has come up with a way
> to hide the complexity for keyboard movement. it's one of those things
> that makes sense to more advanced programmers but not to beginners. We've
> experimented with making a few functions to detect collisions, mouse
> clicks
>
> TIA,
> Bob Irving
> Porter-Gaud School
> Charleston, SC
>
> --
> Twitter: @birv2
> www.bob-irving.com
> http://www.scoop.it/t/on-the-digital-frontier
>
>


Re: [pygame] Re: Need a lot of help with 'virtual' board game

2015-06-30 Thread Noel Garwick
As Winkleink said, the Invent With Pygame stuff is awesome; tons of good
hands-on examples.  The author is very cool and will probably help you out
or recommend a blog post if you have specific questions on how something
works.  http://inventwithpython.com/

For troop movement, if you're making a grid-based game, I recommend this
tile map tutorial:  http://sheep.art.pl/Tiled%20Map%20in%20PyGame

That will help you understand how to break up an area into 'cells'.

For combat, again, you just need to break things down:


   - Characters need data for HP, Attack Power, Accuracy, Dodge Chance,
   Defense
   - Use something like:
  - # see if the attacker hits the defender (there are a LOT of ways to
  do this)
  - hit = False
  - if ( random.randint( 0, 100 ) + attacker.accuracy ) >
  defender.DodgeChance:
 - hit = True
  - # If the attack hits, lower the defender's HP, adjusting the damage
  by the defender's defense
  - if hit:
 - damage = attacker.attack_power - defender.defense
 - if damage >= 0:
- defender.hp -= damage
 - # check if the defender is dead; if so, remove hide sprite, etc.,
  - if defender.hp <= 0:
 - defender.kill()


On Tue, Jun 30, 2015 at 3:48 PM, Michael  wrote:

> I actually coded my own pong game, I forgot to add a pause menu though.
> However, I still need to know how to code in 'combat' (die rolls,
> causalities ETC.)
> Movement of troops
> and still alll the others listed above.
>
>
>
> --
> View this message in context:
> http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965p1968.html
> Sent from the pygame-users mailing list archive at Nabble.com.
>


Re: [pygame] Need a lot of help with 'virtual' board game

2015-06-30 Thread Noel Garwick
Hi Michael,

You will want to break all of these down into smaller jobs, and then break
those down further.  Have you tried making Pong yet? I know it sounds
super-simple, but by implementing Pong you actually cover a ton of concepts
that you will use when making games:


   - Player input
   - Movement
   - AI
  -  Ball
 - Increment x / y by x / y speed each frame unless collide with
 ball or collide with wall
  - Storing sprite positions
   - Storing other variables (score, etc)
   - Drawing (blitting) sprites and backgrounds to a window
   - Basic state machine (Title screen, gameplay, 'paused', game over)


All of the features you're listing for your board game uses concepts that
build off of these.

On Tue, Jun 30, 2015 at 2:53 PM, Michael  wrote:

> Hello, novice coder here.
>
> I need help coding a board game.
>
> What I need to learn (because I dont know how to do it already):
> Combat (die rolls, have troops removed on those die rolls)
> An interactive map (Player/players can move the map around to view a
> different area, zoom in and out ETC.)
> Units movement.
> Having a video play in the backround (I want the 'home' screen to have a
> video playing in the background where it fades to different pictures.)
> An option to 'save' the game in its current state.
> and lastly having a desktop shortcut tp run the game (so you dont have to
> access the folder and find the program from there.)
>
> It is a lot, but I am very novice, and REALLY want to learn all of this, so
> even if you can only give some help for a couple, it will be much
> appreciated! :)
>
> Thanks in advance!
>
>
>
> --
> View this message in context:
> http://pygame-users.25799.x6.nabble.com/Need-a-lot-of-help-with-virtual-board-game-tp1965.html
> Sent from the pygame-users mailing list archive at Nabble.com.
>


Re: [pygame] freetype problem

2015-03-12 Thread Noel Garwick
Try doing this instead:

# -*- encoding: utf-8 -*-
import pygame
from pygame import constants, event, display
from pygame import freetype

pygame.init()
freetype.init()
screen = display.set_mode((300, 200))
screen.fill(pygame.Color('White'))
f = pygame.freetype.SysFont('Times New Roman', 19)
f.underline = True
s, rec = f.render(u'Amazon')


try:
loop = True
while loop:
for ev in event.get():
if ev.type == constants.QUIT:
loop = False
elif ev.type == constants.KEYDOWN and ev.key ==
constants.K_ESCAPE:
loop = False
screen.blit(s, (10, 30))
display.flip()
finally:
freetype.quit()
display.quit()

On Thu, Mar 12, 2015 at 11:06 AM, Benni Bärmann 
wrote:

> no crash in linux here. looks like a windows specific problem.
>
> 2015-03-12 14:38 GMT+01:00 Bo Jangeborg :
>
>> How stable is the freetype module ? I have been running into problems
>> with it hanging my app completly. The following code should demonstrate
>> the problem. Pressing ESC and you'll see that it has crashed. However
>> if you set the underline parameter to 'False' things work nicely.
>> I am running it on Windows 7.
>>
>> # -*- encoding: utf-8 -*-
>> import pygame
>> from pygame import constants, event, display
>> from pygame import freetype
>>
>> pygame.init()
>> freetype.init()
>> screen = display.set_mode((300, 200))
>> display.flip()
>> screen.fill(pygame.Color('White'))
>> display.flip()
>> f = pygame.freetype.SysFont('Times New Roman', 19)
>> f.underline = True
>> s, rec = f.render(u'Amazon')
>> screen.blit(s, (10, 30))
>> display.flip()
>>
>> try:
>> loop = True
>> while loop:
>> for ev in event.get():
>> if ev.type == constants.QUIT:
>> loop = False
>> elif ev.type == constants.KEYDOWN and ev.key ==
>> constants.K_ESCAPE:
>> loop = False
>> finally:
>> freetype.quit()
>> display.quit()
>>
>
>


Re: [pygame] emulating /replacing py2exe for pygame projects using python 3 and abore

2014-10-30 Thread Noel Garwick
Hi Diliup,

I am interested in seeing your py2exe script.

Thank you,
Noel

On Thu, Oct 30, 2014 at 5:15 AM, diliup gabadamudalige 
wrote:

> I use py2ex.
> I pack sound, images and fonts as data into py files so that py2exe
> produces only 1 exe file with no other files or folders. workds only
> windows.
> if you like i can send you my py2exe script.
>
>
> On Wed, Oct 29, 2014 at 11:12 PM, Ian Dickinson  > wrote:
>
>> Thanks thats great
>>
>> On 29 October 2014 16:58, Thomas Kluyver  wrote:
>>
>>> On 29 October 2014 08:14, NuMedia  wrote:
>>>
 Can i emulate py2exe for python version 3 and above i also use pygame
 any
 suggestions for a basic staring script would be greatly appreciated

>>>
>>> I'm involved with two projects that do similar things, and work on
>>> Python 3:
>>>
>>> cx_Freeze (http://cx-freeze.sourceforge.net/ ) works in quite a similar
>>> way, to produce an executable for your application, along with a set of
>>> associated files.
>>>
>>> Pynsist (http://pynsist.readthedocs.org/en/latest/ ) is more different:
>>> it produces a Windows installer that unpacks the Python files onto the
>>> target user's computer. It's quite new, but there is a pygame example:
>>> https://github.com/takluyver/pynsist/tree/master/examples/pygame
>>>
>>> Thomas
>>>
>>
>>
>
>
> --
> Diliup Gabadamudalige
>
> http://www.diliupg.com
> http://soft.diliupg.com/
>
>
> **
> This e-mail is confidential. It may also be legally privileged. If you are
> not the intended recipient or have received it in error, please delete it
> and all copies from your system and notify the sender immediately by return
> e-mail. Any unauthorized reading, reproducing, printing or further
> dissemination of this e-mail or its contents is strictly prohibited and may
> be unlawful. Internet communications cannot be guaranteed to be timely,
> secure, error or virus-free. The sender does not accept liability for any
> errors or omissions.
>
> **
>
>


Re: [pygame] Requesting a hand with a simple Death Counter

2014-10-27 Thread Noel Garwick
Not all events have a .key attribute (QUIT and MOUSEMOTION) for example. So
instead, do something like this:

for event in events:
if event.type == pygame.KEYDOWN:
if event.key == K_1:
# logic here
On Oct 27, 2014 6:20 AM, "PBRGamer"  wrote:

> Learning how to program in python with pygame and could use a hand. I'm
> certain I'm doing a lot wrong.
>
> Purpose of program.
>
> While running in the background...
> Press the '1' Key and it opens a file, takes the #, adds +1 to it, then
> writes the new number in the file over the old number.
> Press the '2' Key and it opens the file, and writes a 0 over the number in
> the file.
>
> Getting an error on line 19 while trying to modify a tutorial on something
> else to meet my needs.
>
> if event.key == pygame.K_1:
> AttributeError: event member not defined
>
> Here is the rest of the code.
>
> # Death Counter
> import pygame, sys
> import pygame.locals
>
> # Variables
> deathcount = float(0)
>
> pygame.init()
> BLACK = (0,0,0)
> WIDTH = 320
> HEIGHT = 260
> windowSurface = pygame.display.set_mode((WIDTH, HEIGHT), 0, 32)
>
> windowSurface.fill(BLACK)
>
> while True:
> events = pygame.event.get()
> for event in events:
> if event.key == pygame.K_1:
> with open("deathcounter.txt", "rt") as in_file:
> deathcount = in_file.read()
> deathcount = deathcount + 1
> with open("deathcounter.txt", "wt") as out_file:
> out_file.write(deathcount)
> if event.key == pygame.K_2:
> deathcount = 0
> with open("deathcounter.txt", "wt") as out_file:
> out_file.write(deathcount)
>
> pass
> if event.type == QUIT:
> pygame.quit()
> sys.exit()
>
> Thanks for your help =)
>
>
>
>
>
> --
> View this message in context:
> http://pygame-users.25799.x6.nabble.com/Requesting-a-hand-with-a-simple-Death-Counter-tp1481.html
> Sent from the pygame-users mailing list archive at Nabble.com.
>


Re: [pygame] encrypt/decrypt zip/unzip

2014-08-25 Thread Noel Garwick
Diliup,

My understanding is that anything you load into memory can be dumped.  So
if you're just using this to load all game assets at startup, people could
extract the assets by duping what the interpreter has loaded into memory
(the copies of the unencrypted files).


On Mon, Aug 25, 2014 at 11:52 AM, Vincent Michel 
wrote:

> "the password is obfuscated and saved to a py file"
> I'm curious about this part, how would you do that?
> Do you plan to distribute only your byte code and hope that no one will
> reverse it?
>
> Also, why do you need a double encryption? If you want to prevent people
> from browsing your package to find the end screen or whatever, isn't
> your first encryption enough?
>
> Anyway I think it's an interesting question, I mean, how important is it
> to obfuscate game data.
>
> Vincent
>
> On Mon, 2014-08-25 at 19:38 +0530, diliup gabadamudalige wrote:
> > Having experimented with various methods to obfuscate image, audio and
> > text files, store them in a zip file pw protect and then retrieving on
> > demand  I finally did this.
> >
> >
> > coder= a long string with a lot of characters ( written in a separate
> > py file)
> >
> >
> > strA = XOR(from_disk.read(), coder)
> > str1 = XOR(strA,another_coder))
> >
> >
> > encryption twice to obfuscate even more.
> >
> >
> > with open(code_to_dir, "wb") as to_disk:
> > to_disk.write(str1)
> >
> >
> > then i used win rar to write these files to disk as a pw protected zip
> > file with store as the comp. method.
> >
> >
> > the password is obfuscated and saved to a py file
> >
> >
> > Retrieving the files from inside the zip file was the only hitch as
> > the python extract routine took a long time.
> >
> >
> > this was solved by a great package at
> > https://pypi.python.org/pypi/czipfile#downloads
> >
> >
> > retrieval time increase by nearly/more than/almost 200 %.
> >
> >
> > I would like to have your input on the above.
> >
> >
> >
> > Diliup Gabadamudalige
> >
> > http://www.diliupg.com
> > http://soft.diliupg.com/
> >
> >
> **
> > This e-mail is confidential. It may also be legally privileged. If you
> > are not the intended recipient or have received it in error, please
> > delete it and all copies from your system and notify the sender
> > immediately by return e-mail. Any unauthorized reading, reproducing,
> > printing or further dissemination of this e-mail or its contents is
> > strictly prohibited and may be unlawful. Internet communications
> > cannot be guaranteed to be timely, secure, error or virus-free. The
> > sender does not accept liability for any errors or omissions.
> >
> **
> >
> >
>
>
>


Re: [pygame] image conversion in memory

2014-08-14 Thread Noel Garwick
Password protected zip would work.

You can also look into what renpy's .rpa format does.


On Thu, Aug 14, 2014 at 1:07 PM, diliup gabadamudalige 
wrote:

> I am reading up on creating and using zip files and may possibly use it,
> What I am trying to do here is to hide the images on disk so that a user
> of the program will not be able to manipulate or change the images. What
> other way can you suggest?
> Thanks for all the help so far.
>
>
> On Wed, Aug 13, 2014 at 10:10 PM, Radomir Dopieralski  > wrote:
>
>> On 08/13/2014 04:35 PM, diliup gabadamudalige wrote:
>> > This is the complete and correct code. Can anyone say what;s wrong?
>> > Thanks in advance.
>> >
>> >
>> > import pygame
>> > import StringIO
>> >
>> > putimage = pygame.image.load("88keykbd.png")
>> > buff = StringIO.StringIO()
>> > buff.name  = '88keykbd.png'
>> >
>> > pygame.image.save(putimage, buff)
>> >
>> > putimage = buff.getvalue()
>> > print "buff:", type(buff), "myimage:", type(putimage), "getimage:",
>> > type(putimage)
>> >
>> > print len(putimage)
>> > with open('myscrambledimage.dat', 'w') as newfile:
>> > newfile.write(putimage)
>> >
>> > with open('myscrambledimage.dat', 'r') as newfile:
>> > getimage= newfile.read()
>> > print len(getimage)
>>
>> Open both files in binary mode, with 'wb' and 'rb' respectively.
>> Especially if you are on some funny operating system, like Windows.
>>
>> Have you considered just putting all your images in a zip file, instead
>> of encoding them in strange ways?
>>
>>
>> --
>> The Sheep
>>
>
>
>
> --
> Diliup Gabadamudalige
>
> http://www.diliupg.com
> http://soft.diliupg.com/
>
>
> **
> This e-mail is confidential. It may also be legally privileged. If you are
> not the intended recipient or have received it in error, please delete it
> and all copies from your system and notify the sender immediately by return
> e-mail. Any unauthorized reading, reproducing, printing or further
> dissemination of this e-mail or its contents is strictly prohibited and may
> be unlawful. Internet communications cannot be guaranteed to be timely,
> secure, error or virus-free. The sender does not accept liability for any
> errors or omissions.
>
> **
>
>


Re: [pygame] image conversion in memory

2014-08-13 Thread Noel Garwick
since myimage is using pygame.image.load, it might be indexed?  On the
other hand, it's also possible that pygame.image.save is actually
performing some compression when it saves to a png format?  I'm not sure
offhand, but something to check out.


On Wed, Aug 13, 2014 at 10:02 AM, diliup gabadamudalige 
wrote:

> Sorry there was a small error in the previous message. My apologies.
>
> import pygame
> import StringIO
>
> myimage = pygame.image.load("88keykbd.png")
> buff = StringIO.StringIO()
> buff.name = '88keykbd.png'
> pygame.image.save(myimage, buff)
>
> putimage = buff.getvalue()
> print "buff:", type(buff), "myimage:", type(myimage), "getimage:",
> type(putimage)
>
> print len(putimage)
> with open('myscrambledimage.dat', 'w') as newfile:
> newfile.write(putimage)
>
> with open('myscrambledimage.dat', 'r') as newfile:
> getimage= newfile.read()
> print len(getimage)
>
>
>
> On Wed, Aug 13, 2014 at 7:30 PM, diliup gabadamudalige 
> wrote:
>
>> can any good soul out there tell me why these two files are not the same
>> size?
>>
>> import pygame
>> import StringIO
>>
>> myimage = pygame.image.load("88keykbd.png")
>> buff = StringIO.StringIO()
>> buff.name = '88keykbd.png'
>> pygame.image.save(myimage, buff)
>>
>> putimage = buff.getvalue()
>> print "buff:", type(buff), "myimage:", type(myimage), "getimage:",
>> type(putimage)
>>
>> print len(getimage)
>> with open('myscrambledimage.dat', 'w') as newfile:
>> newfile.write(putimage)
>>
>> with open('myscrambledimage.dat', 'r') as newfile:
>> getimage= newfile.read()
>> print len(getimage)
>>
>> len(putimage) and len(getimage) are hugely different in size and I can't
>> see why as it is putimage that is written to file and then read back as
>> getimage.
>>
>> Clarification on this would be immensly welcome.
>>
>> Thank you in advance
>>
>>
>> On Tue, Aug 12, 2014 at 9:53 PM, diliup gabadamudalige > > wrote:
>>
>>> Hi Radomir,
>>>
>>> Thanks for the response.
>>> ok. This is what i want to do
>>> i want to try to convert images into a string format and store them on
>>> disk. Better if they are unprintable characters.
>>> then when i want to see them i will run them thrugh a decryption python
>>> script and viola they will be displayed in pygame
>>> when i close the program again i will have only the encoded 'imageds' on
>>> the hd.
>>> I did this using
>>>
>>> get_screen = SCREEN.subsurface(0, 0, SCREENW, SCREENH)
>>> with open(image_filename, "rb") as imageFile:
>>> imagestr = base64.b64encode(imageFile.read())
>>> ## create the text file name to save to disk
>>> text_filename = newpath + "s" + str(va.page) + ".dat"
>>> ## save imagestr(image as a textfle) to disk
>>> with open(text_filename, "wb") as f:
>>> f.write(imagestr)
>>>
>>> I wanted a better way and hence the question.
>>>
>>> stringio or cstringio is fine. i can save the string to disk but how can
>>> i convert it back to an image file?
>>>
>>> Thank you for your help.
>>>
>>>
>>>
>>>
>>> On Tue, Aug 12, 2014 at 11:12 AM, Radomir Dopieralski <
>>> pyg...@sheep.art.pl> wrote:
>>>
 On 08/11/2014 09:53 PM, diliup gabadamudalige wrote:
 > type(f) gives 
 > yourimage = f.getvalue()
 > with open('myscrambledimage.dat', 'w') as f:
 > f.write(yourimage)
 > so i coukld write this file to disk
 >
 > now how can i convert this back to an image?
 > Thanks in advance

 What are you actually tryig to do?
 I'm sure there is a simpler way.

 --
 The Sheep

>>>
>>>
>>>
>>> --
>>> Diliup Gabadamudalige
>>>
>>> http://www.diliupg.com
>>> http://soft.diliupg.com/
>>>
>>>
>>> **
>>> This e-mail is confidential. It may also be legally privileged. If you
>>> are not the intended recipient or have received it in error, please delete
>>> it and all copies from your system and notify the sender immediately by
>>> return e-mail. Any unauthorized reading, reproducing, printing or further
>>> dissemination of this e-mail or its contents is strictly prohibited and may
>>> be unlawful. Internet communications cannot be guaranteed to be timely,
>>> secure, error or virus-free. The sender does not accept liability for any
>>> errors or omissions.
>>>
>>> **
>>>
>>>
>>
>>
>> --
>> Diliup Gabadamudalige
>>
>> http://www.diliupg.com
>> http://soft.diliupg.com/
>>
>>
>> **
>> This e-mail is confidential. It may also be legally privileged. If you
>> are not the intended recipient or have received it in error, please delete
>> it and all copies from your system and notify the sender immediately by
>> return e-mail. Any unauthorized reading, reproducing, printing or further
>> dissemination of this e-mail or its contents is strictly prohibited and may
>> be unlawful. Inte

Re: [pygame] Fwd: Missing Module and Font

2014-08-01 Thread Noel Garwick
Awesome.  So I guess someone needs to re-compile the installer and submit
it?


On Thu, Jul 31, 2014 at 4:14 PM, diliup gabadamudalige 
wrote:

> Dear all,
>
> This is what finally worked for me.
>
> As all previous attempts and methods didn't work I uninstalled Pygame and
> downloaded it from
>
> https://bitbucket.org/pygame/pygame/downloads
>
>  pygame-1.9.2a0.win32-py2.7.msi
> <https://bitbucket.org/pygame/pygame/downloads/pygame-1.9.2a0.win32-py2.7.msi>
> 3.8 MBllindstrom <https://bitbucket.org/llindstrom> 28275
> 2013-08-29
>
>
>
> I installed it and removed the line import pygame._view from my main
> program and modules.
>
> now I can import  pygame.freetype and also  do a 100% successful
> compilation of everything with py2exe.
>
> So somehow contrary to what I was told this particular build looks like
> the correct version or somehow works without a problem in every way. Hope
> this is useful to everybody.
>
> Thank you very much for your valuable time taken to assist me.
>
> May you be well
>
> DiliupG
> Everything works fine.
>
>
> On Fri, Aug 1, 2014 at 1:06 AM, diliup gabadamudalige 
> wrote:
>
>> Noel,
>> I uninstalled everything. Deleted the Python folder too.
>> Installed everythin from scratch. Python 2.7.8 32 bit and Pygame from the
>> above location
>> STILL NO pygame.freetype.
>> get the error below.
>> ImportError: No module named freetype
>>  I am thinking of reinstalling Windows 7 64 bit (which is the current os)
>> and doing everything from scratch.
>> Any suggerstions?
>>
>>
>>
>> On Thu, Jul 31, 2014 at 9:36 PM, Noel Garwick 
>> wrote:
>>
>>> Diliup,
>>>
>>> You want this one from http://www.pygame.org/download.shtml:
>>>
>>>- pygame-1.9.2a0.win32-py2.7.msi
>>><http://pygame.org/ftp/pygame-1.9.2a0.win32-py2.7.msi> 6.4MB
>>>
>>> The freetype module is new in pygame 1.9.2, so you can't use the 1.9.1
>>> builds.
>>>
>>> For making it work with py2exe, after you install the above, make sure
>>> that you are configuring it to use python2.7 32 bit and not another version
>>> on your system.
>>>
>>>
>>> On Thu, Jul 31, 2014 at 11:57 AM, diliup gabadamudalige <
>>> dili...@gmail.com> wrote:
>>>
>>>> PLEASE HELP. URGENT.
>>>>
>>>> -- Forwarded message --
>>>> From: diliup gabadamudalige 
>>>>  Date: Thu, Jul 31, 2014 at 7:34 PM
>>>> Subject: Re: [pygame] Fwd: Missing Module and Font
>>>> To: pygame-users@seul.org
>>>>
>>>>
>>>> https://bitbucket.org/pygame/pygame/downloads
>>>> http://pygame.info/downloads/
>>>>
>>>> the above two links have a Pygame installation 3.76MB in size
>>>>
>>>> http://www.pygame.org/download.shtml
>>>>
>>>> the above link has a Pygame installation which is 6.14MB in size.
>>>>
>>>> Which is the one I should use or is ther a build with the modules I
>>>> mentioned above?
>>>>
>>>> So far I am using Python 2.7.8.32 bit and Pygame 32 on a Win 7 64 bit os
>>>>
>>>>
>>>>
>>>> On Thu, Jul 31, 2014 at 7:28 PM, diliup gabadamudalige <
>>>> dili...@gmail.com> wrote:
>>>>
>>>>> Thank you very much for your reply.
>>>>>
>>>>> Let's forget Py2exe for now.
>>>>>
>>>>> Even on Python 2.7.8 I still can't import freefont Why does the Pygame
>>>>> build differ in size on differnt official websites? Which one has all the
>>>>> libraries. I installed the one from bitbucket which allowed me to import
>>>>> freefonts but didn't have the pygame._view module. And in the pygame i
>>>>> downloaded from the Pygame site is 6.1MB in size and does not let me 
>>>>> import
>>>>> freefonts.  Why is this? Where can I get a Pygame installation with BOTH
>>>>> Pygame._view modue AND freefont support?
>>>>>
>>>>> I am unable to use the new freetype fonts and copmpile to exe because
>>>>> of these two errors.
>>>>>
>>>>> Help is much appreciated.
>>>>>
>>>>> Thank you very much.
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Jul 31, 2014 at 6:45 PM, Jeffrey Kleykamp <
>>>>> jeffrey.kley

Re: [pygame] Fwd: Missing Module and Font

2014-07-31 Thread Noel Garwick
Hey Diliup,

Py2exe can be a little klugey to set up.  I remember there being a good bit
of trial and error during pyweek.  Good luck! :)


On Thu, Jul 31, 2014 at 12:16 PM, diliup gabadamudalige 
wrote:

> Tgank you very much Noel. Much Appreciated. I will do as you ask. I will
> uninstall Python and Pygame and reinstall all as you say from scratch. I
> hope the missing module pygame._view error will not occur after compiling
> with py2exe.
>
> Thanks so much.
>
>
> On Thu, Jul 31, 2014 at 9:36 PM, Noel Garwick 
> wrote:
>
>> Diliup,
>>
>> You want this one from http://www.pygame.org/download.shtml:
>>
>>- pygame-1.9.2a0.win32-py2.7.msi
>><http://pygame.org/ftp/pygame-1.9.2a0.win32-py2.7.msi> 6.4MB
>>
>> The freetype module is new in pygame 1.9.2, so you can't use the 1.9.1
>> builds.
>>
>> For making it work with py2exe, after you install the above, make sure
>> that you are configuring it to use python2.7 32 bit and not another version
>> on your system.
>>
>>
>> On Thu, Jul 31, 2014 at 11:57 AM, diliup gabadamudalige <
>> dili...@gmail.com> wrote:
>>
>>> PLEASE HELP. URGENT.
>>>
>>> -- Forwarded message --
>>> From: diliup gabadamudalige 
>>>  Date: Thu, Jul 31, 2014 at 7:34 PM
>>> Subject: Re: [pygame] Fwd: Missing Module and Font
>>> To: pygame-users@seul.org
>>>
>>>
>>> https://bitbucket.org/pygame/pygame/downloads
>>> http://pygame.info/downloads/
>>>
>>> the above two links have a Pygame installation 3.76MB in size
>>>
>>> http://www.pygame.org/download.shtml
>>>
>>> the above link has a Pygame installation which is 6.14MB in size.
>>>
>>> Which is the one I should use or is ther a build with the modules I
>>> mentioned above?
>>>
>>> So far I am using Python 2.7.8.32 bit and Pygame 32 on a Win 7 64 bit os
>>>
>>>
>>>
>>> On Thu, Jul 31, 2014 at 7:28 PM, diliup gabadamudalige <
>>> dili...@gmail.com> wrote:
>>>
>>>> Thank you very much for your reply.
>>>>
>>>> Let's forget Py2exe for now.
>>>>
>>>> Even on Python 2.7.8 I still can't import freefont Why does the Pygame
>>>> build differ in size on differnt official websites? Which one has all the
>>>> libraries. I installed the one from bitbucket which allowed me to import
>>>> freefonts but didn't have the pygame._view module. And in the pygame i
>>>> downloaded from the Pygame site is 6.1MB in size and does not let me import
>>>> freefonts.  Why is this? Where can I get a Pygame installation with BOTH
>>>> Pygame._view modue AND freefont support?
>>>>
>>>> I am unable to use the new freetype fonts and copmpile to exe because
>>>> of these two errors.
>>>>
>>>> Help is much appreciated.
>>>>
>>>> Thank you very much.
>>>>
>>>>
>>>>
>>>> On Thu, Jul 31, 2014 at 6:45 PM, Jeffrey Kleykamp <
>>>> jeffrey.kleyk...@gmail.com> wrote:
>>>>
>>>>> I don't know anything about py2exe but does this website help?
>>>>> phttp://bytes.com/topic/python/answers/848048-py2exe-module-error
>>>>>
>>>>>
>>>>> On Thu, Jul 31, 2014 at 5:27 AM, diliup gabadamudalige <
>>>>> dili...@gmail.com> wrote:
>>>>>
>>>>>> someone please help!
>>>>>>
>>>>>>
>>>>>> -- Forwarded message --
>>>>>> From: diliup gabadamudalige 
>>>>>> Date: Thu, Jul 31, 2014 at 1:33 AM
>>>>>> Subject: Missing Module and Font
>>>>>> To: pygame-users@seul.org
>>>>>>
>>>>>>
>>>>>> Dear Peter or anyone else who can help me,
>>>>>>
>>>>>> I downloaded
>>>>>>
>>>>>>- pygame-1.9.2a0.win32-py2.7.msi
>>>>>><http://pygame.org/ftp/pygame-1.9.2a0.win32-py2.7.msi> 6.4MB
>>>>>>
>>>>>> from the Pygmaesite and everything runs smoothly. I can comile using
>>>>>> py2exe without any error. BUT I CANNOT import pygame.freetype. Gives me 
>>>>>> the
>>>>>> following error.
>>>>>> ImportError: No module named freetype
>>>>>>
>>>&

Re: [pygame] Fwd: Missing Module and Font

2014-07-31 Thread Noel Garwick
Diliup,

You want this one from http://www.pygame.org/download.shtml:

   - pygame-1.9.2a0.win32-py2.7.msi
    6.4MB

The freetype module is new in pygame 1.9.2, so you can't use the 1.9.1
builds.

For making it work with py2exe, after you install the above, make sure that
you are configuring it to use python2.7 32 bit and not another version on
your system.

On Thu, Jul 31, 2014 at 11:57 AM, diliup gabadamudalige 
wrote:

> PLEASE HELP. URGENT.
>
> -- Forwarded message --
> From: diliup gabadamudalige 
> Date: Thu, Jul 31, 2014 at 7:34 PM
> Subject: Re: [pygame] Fwd: Missing Module and Font
> To: pygame-users@seul.org
>
>
> https://bitbucket.org/pygame/pygame/downloads
> http://pygame.info/downloads/
>
> the above two links have a Pygame installation 3.76MB in size
>
> http://www.pygame.org/download.shtml
>
> the above link has a Pygame installation which is 6.14MB in size.
>
> Which is the one I should use or is ther a build with the modules I
> mentioned above?
>
> So far I am using Python 2.7.8.32 bit and Pygame 32 on a Win 7 64 bit os
>
>
>
> On Thu, Jul 31, 2014 at 7:28 PM, diliup gabadamudalige 
> wrote:
>
>> Thank you very much for your reply.
>>
>> Let's forget Py2exe for now.
>>
>> Even on Python 2.7.8 I still can't import freefont Why does the Pygame
>> build differ in size on differnt official websites? Which one has all the
>> libraries. I installed the one from bitbucket which allowed me to import
>> freefonts but didn't have the pygame._view module. And in the pygame i
>> downloaded from the Pygame site is 6.1MB in size and does not let me import
>> freefonts.  Why is this? Where can I get a Pygame installation with BOTH
>> Pygame._view modue AND freefont support?
>>
>> I am unable to use the new freetype fonts and copmpile to exe because of
>> these two errors.
>>
>> Help is much appreciated.
>>
>> Thank you very much.
>>
>>
>>
>> On Thu, Jul 31, 2014 at 6:45 PM, Jeffrey Kleykamp <
>> jeffrey.kleyk...@gmail.com> wrote:
>>
>>> I don't know anything about py2exe but does this website help?
>>> phttp://bytes.com/topic/python/answers/848048-py2exe-module-error
>>>
>>>
>>> On Thu, Jul 31, 2014 at 5:27 AM, diliup gabadamudalige <
>>> dili...@gmail.com> wrote:
>>>
 someone please help!


 -- Forwarded message --
 From: diliup gabadamudalige 
 Date: Thu, Jul 31, 2014 at 1:33 AM
 Subject: Missing Module and Font
 To: pygame-users@seul.org


 Dear Peter or anyone else who can help me,

 I downloaded

- pygame-1.9.2a0.win32-py2.7.msi
 6.4MB

 from the Pygmaesite and everything runs smoothly. I can comile using
 py2exe without any error. BUT I CANNOT import pygame.freetype. Gives me the
 following error.
 ImportError: No module named freetype

 Now when I download Pygame from the link below
 https://bitbucket.org/pygame/pygame/downloads

 I can do import pygame.freetype but whn I compile the program using
 py2exe I get an error
 import pygame._view error. module not found.

 Please help as this is causing a LOT of preoblems and I am stuck
 between the view module and the freefont. Kind of uncomfortable here so
 please help me.

 Thank you very much in advance.
 --
 Diliup Gabadamudalige

 http://www.diliupg.com
 http://soft.diliupg.com/


 **
 This e-mail is confidential. It may also be legally privileged. If you
 are not the intended recipient or have received it in error, please delete
 it and all copies from your system and notify the sender immediately by
 return e-mail. Any unauthorized reading, reproducing, printing or further
 dissemination of this e-mail or its contents is strictly prohibited and may
 be unlawful. Internet communications cannot be guaranteed to be timely,
 secure, error or virus-free. The sender does not accept liability for any
 errors or omissions.

 **




 --
 Diliup Gabadamudalige

 http://www.diliupg.com
 http://soft.diliupg.com/


 **
 This e-mail is confidential. It may also be legally privileged. If you
 are not the intended recipient or have received it in error, please delete
 it and all copies from your system and notify the sender immediately by
 return e-mail. Any unauthorized reading, reproducing, printing or further
 dissemination of this e-mail or its contents is strictly prohibited and may
 be unlawful. Internet communications cannot be guaranteed to be timely,
 sec

Re: [pygame] OpenGL stretch of a pygame.Surface

2014-07-28 Thread Noel Garwick
vertpingouin,

If you are doing that every frame as part of the sprite's .draw or .update
method , it's still possible the transform is what is taking up CPU time.
 You may want to use something like this instead:

class MySpriteThing( pygame.sprite.Sprite):
image = None
def __init___( self ):

.
if MySpriteThing.image is None:
MySpriteThing.image = pygame.image.load( "foo.png" )
size = MySpriteThing.image.get_size()
new_width = size[0] * X_SCALE # where X_SCALE is the ratio
between RESOLUTION_X (the big resolution) and GRAPHICS_X (the resolution
the images were made at) ; ( 1920 / 640 )
new_height = size[1] * Y_SCALE
MySpriteThing..image = pygame.transform.scale( self.image, (
new_width, new_height ) )

self.image = MySpriteThing.image



# then, in your main loop, blit the sprite's .image attribute to your
display surface

mySpriteGroup.draw( screen )

pygame.display.update()



On Mon, Jul 28, 2014 at 4:41 PM, vertpingouin <
sylvain.bousse...@vertpingouin.fr> wrote:

> to Sam :
> I'm using HWSURFACE flag but I got exatly the same framerate. The ideal
> would be to rewrite everything in openGL but I don't know it well...
> yet.
>
> to Noel:
> On the topic of performing transform one time only, I'm not sure what
> mean here. If I scale my surface one time, it gets, say, 1920x1080, but
> then blitting is done only of a 640x480 part of the surface... So maybe
> I misunderstood something here.
>
> I'm using this to transform :
>
> pygame.transform.scale(self.native, (SCREENWIDTH, SCREENHEIGHT),
> self.screen)
>
> where native is the little one and screen the big one. I assume that
> self.native is scaled then blit onto self.screen...
>
> I think this is the blitting that is slow because if I use a lesser
> resolution for self.screen, I almost get back my precious frames per
> second.
>
> It will be really cool to send my little native surface to my graphic
> card, then let it scale by itself. Don't know if it's even possible.
>
>
> Le lundi 28 juillet 2014 à 11:50 -0400, Noel Garwick a écrit :
> > Right now you are blitting tiles to a 640x480 surface, and then
> > performing a transform on the whole surface and then blitting it to
> > the display?
> >
> >
> > If this is the case, then try to only perform the scale operation when
> > the resolution is changed (instead of once each frame) and see how
> > that works.  I know you mentioned that the full screen blit operation
> > seems to be the main bottleneck, but this should help too.
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Jul 28, 2014 at 7:32 AM, Sam Bull 
> > wrote:
> > On lun, 2014-07-28 at 06:54 +0200, VertPingouin wrote:
> > > So I came up with the idea of an hardware opengl texture
> > stretching
> > > instead of a dumb blit but I don't know how to achieve it.
> > >
> > > Anyone has already done this ?
> > >
> >
> >
> > You would just need to code the graphics in OpenGL without
> > using
> > pygame.Surface and pygame.draw. First though, check you are
> > using the
> > HWSURFACE flag, if you are running fullscreen, it's possible
> > this might
> > provide the necessary speedup without going to OpenGL.
> >
> >
> http://www.pygame.org/docs/ref/display.html#pygame.display.set_mode
> >
> >
>
>
>


Re: [pygame] OpenGL stretch of a pygame.Surface

2014-07-28 Thread Noel Garwick
Right now you are blitting tiles to a 640x480 surface, and then performing
a transform on the whole surface and then blitting it to the display?

If this is the case, then try to only perform the scale operation when the
resolution is changed (instead of once each frame) and see how that works.
 I know you mentioned that the full screen blit operation seems to be the
main bottleneck, but this should help too.





On Mon, Jul 28, 2014 at 7:32 AM, Sam Bull  wrote:

> On lun, 2014-07-28 at 06:54 +0200, VertPingouin wrote:
> > So I came up with the idea of an hardware opengl texture stretching
> > instead of a dumb blit but I don't know how to achieve it.
> >
> > Anyone has already done this ?
> >
>
> You would just need to code the graphics in OpenGL without using
> pygame.Surface and pygame.draw. First though, check you are using the
> HWSURFACE flag, if you are running fullscreen, it's possible this might
> provide the necessary speedup without going to OpenGL.
>
> http://www.pygame.org/docs/ref/display.html#pygame.display.set_mode
>


Re: [pygame] Re: Pygame not handling keyboard tracking correctly

2014-06-22 Thread Noel Garwick
Im curious why "is" is bad in this case, as well. It's a constant; isn't
that a good use for is, whether it's referring to an int or not? I tend to
do this for event handling.  Maybe ints are always pointers in python?

The caveat for events is just warning you that the queue could fill up if
you didnt call pygame.event.get() at all.
On Jun 23, 2014 2:16 AM, "diliup gabadamudalige"  wrote:

> I called event.clear() cause it says in the Pygame documentation that if
> you leave unused events on the buffer that eventually it may fill up and
> cause the program to crash.
>
> Also can you explain why
>
> if x is True:
> is not correct
> and
>
> if x == True
> is correct?
>
>
> On Mon, Jun 23, 2014 at 11:34 AM, Greg Ewing 
> wrote:
>
>> diliup gabadamudalige wrote:
>>
>>> pygame.event.clear()
>>> before exiting the function
>>>
>>> somehow when I removed that line the error stopped.
>>>
>>
>> That would definitely be it! You were throwing away any
>> events that came in between calling event.get() and
>> reaching the end of your function. Not a good idea when
>> you rely critically on seeing *all* key up events.
>>
>> I don't know why you thought you needed to call
>> event.clear(), but whatever your reason was, it was
>> probably wrong.
>>
>>
>>  So may be I had to keep all the unused events for the next time the loop
>>> was entered. Is that correct?
>>>
>>
>> Exactly correct.
>>
>> --
>> Greg
>>
>
>
>
> --
> Diliup Gabadamudalige
>
> http://www.diliupg.com
> http://soft.diliupg.com/
>
>
> **
> This e-mail is confidential. It may also be legally privileged. If you are
> not the intended recipient or have received it in error, please delete it
> and all copies from your system and notify the sender immediately by return
> e-mail. Any unauthorized reading, reproducing, printing or further
> dissemination of this e-mail or its contents is strictly prohibited and may
> be unlawful. Internet communications cannot be guaranteed to be timely,
> secure, error or virus-free. The sender does not accept liability for any
> errors or omissions.
>
> **
>
>


Re: [pygame] Lightning Talk Timer

2014-04-15 Thread Noel Garwick
Hi Diliup,

I believe that there is a slight gain in performance when using set_allowed
so that only certain events are added to the queue.  I have never profiled
it, but I doubt that it's terribly more efficient. I would just do the
usual method of polling for events each loop, tracking the held keys, and
handling them appropriately, and see if that meets your requirements.  For
your case, you may not really have to track held keys, and could just run a
function to turn tones on if a key pressed, and off when it is released:

while True:

tslf = fpsClock.tick( FPS )

for event in pygame.events.get():
if event.type == KEYDOWN:
if event.key == K_q:
play_tone( q )
elif event.key == K_2:
play_tone( 2 )
.
elif event.type == KEYUP:
if event.key == K_q:
stop_tone( q )
elif event.key == K_2:
stop_tone( 2 )

# draw and update buttons here...

pygame.display.update()

Thank you,
Noel


On Tue, Apr 15, 2014 at 9:25 AM, diliup gabadamudalige wrote:

> not sure if this is correct to do but I have a question re. Pygame.
>
> Is it faster to set the number of keys being scanned rather than scanning
> the entire keyboard, mouse etc. when getting input in Pygame. I mainly need
> the mouse, arrow keys, , q,2,w,3,e,r,5,t,6,y,7,u,i9,o,0,p,,[,=,] keys ( to
> simulate a 1 1/2 octave MIDI keyboard), the space bar and the Esc keys only
> which are a lot less than the whole lot. Can I Limit to only these keys
> with Pygame.event.set_allowed()
> or
> is there a better way to do this?
>
> Please pardon if i asked the question in the wrong place.
>
>
> On Wed, Mar 19, 2014 at 10:05 PM, René Dudfield  wrote:
>
>> Very cool :)  Thanks for sharing.
>>
>
>
>
> --
> Diliup Gabadamudalige
>
>
> http://www.diliupg.com
> http://soft.diliupg.com/
>
>
> **
> This e-mail is confidential. It may also be legally privileged. If you are
> not the intended recipient or have received it in error, please delete it
> and all copies from your system and notify the sender immediately by return
> e-mail. Any unauthorized reading, reproducing, printing or further
> dissemination of this e-mail or its contents is strictly prohibited and may
> be unlawful. Internet communications cannot be guaranteed to be timely,
> secure, error or virus-free. The sender does not accept liability for any
> errors or omissions.
>
> **
>
>


Re: [pygame] Quick OS survey - 2013

2013-12-06 Thread Noel Garwick
Windows 8 (work desktop at current job; started in May) - 40%
Crunchbang (work desktop at previous job) - 35%
Windows 7 (personal laptop) - 25%



On Fri, Dec 6, 2013 at 1:50 PM, Paul Vincent Craven
wrote:

> Windows 8, along with my students.
>
> Paul Vincent Craven
>
>
> On Fri, Dec 6, 2013 at 10:44 AM, Richard Pouncy 
> wrote:
>
>>  I am new however,
>>
>> 70% Debian Linux
>> 30% Raspberry Pi Debian
>>
>>
>> On 12/5/13 8:43 PM, Jason Marshall wrote:
>>
>>  pygamers, which computer operating system(s) have you used this year?
>> If you have been using more than 1 operating system, approximately what
>> percentage of your time are you using each one?
>>
>>  Here's my breakdown:
>> 0.5%Linux Mint
>>  0.5%Mac OS X 10.4
>>  2%Windows ME
>>  4%Windows XP
>> 5%Mac OS X 10.6
>> 88%Windows 7
>>
>>
>>
>


Re: [pygame] Changelog for Pygame 1.9.2a0 vs 1.9.1

2013-09-25 Thread Noel Garwick
Can you post the source?


On Wed, Sep 25, 2013 at 1:32 PM, Lin Parkh  wrote:

> Hi,
>
> I have a game running fine on pygame 1.9.1 with python 2.5.4 .  I am
> attempting to modernize python to 2.7.5. To that end I have installed
> python 2.7.5 and pygame-1.9.2a0.win32-py2.7Installation worked and the
> program runs. However, now I get occasional odd graphical glitches
> (background fill showing through during some redraws). Never got this in my
> older installation. I did uninstall python 2.5.4 and earlier pygame.
>
> So I am trying to track down what is going on.  To that end I am hoping
> there is a changelog for the changes in pygame from 19.1 to 1.9.2.a0 so
> that  I can narrow down what is going on.
>
> Thanks for any pointers (I searched Google but was not having much luck
> finding a changelog).
>
> On a secondary note I notice font rendering has changed in its sizing
> (it’s smaller now).  I can live with this but should I be expecting to see
> such a change?
>


Re: [pygame] LayeredDirty bug?

2013-07-21 Thread Noel Garwick
Please upload the code so others can test.
On Jul 21, 2013 11:18 AM, "Andrew Barlow"  wrote:

> Hello!
>
> I'm currently just playing around with the PyGame sprite prefabs and I was
> wondering if anyone had ever come across the issue where if you move a
> windowed PyGame that's using LayeredDirty, all updates stop rendering?
>
> It looks like the game loop is still running, but my screen drawing seems
> to stop (even though the list of dirty rects keeps populating). The Window
> title even says "Not Responding" but the Python console output continues to
> print my dirty rects.
>
> Any ideas as to why this might be?
>
> I think its got something to do with the switching between updated regions
> and fullscreen updates  in the LayrerdDirty group, but I really don't know!
>
> I can upload a zip of the code if that's of any help?
>
> Any help with this would be hugely appreciated!
>
> Cheers
>


Re: [pygame] install problem

2013-06-14 Thread Noel Garwick
You need to install the version of pygame for python 3.3. The one you
installed is for python 2.7.
On Jun 14, 2013 12:23 PM, "David"  wrote:

> On my windows 7 PC, I installed Python 3.3.2 Windows x86 MSI 
> Installer
>
> Then I got 
> pygame-1.9.1.win32-py2.7.msi
>
> During the install of pygame it wanted to know where python was installed
> so I put in C:\Python33\ which is correct.
>
> Then I read  to check that Pygame is install correctly, type the following
> into the interactive shell:
>
> >>> import pygame
>
>
> and got this:
>
> Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32
> bit (Intel)] on win32
> Type "copyright", "credits" or "license()" for more information.
> >>> import pygame
> Traceback (most recent call last):
>   File "", line 1, in 
> import pygame
>   File "C:\Python33\lib\site-packages\pygame\__init__.py", line 95, in
> 
> from pygame.base import *
> ImportError: DLL load failed: The specified module could not be found.
> >>>
>
> *Why did it fail?*
>
>
> --
> David
> Running Linux since 1994
>


Re: [pygame] Professional games made with Pygame?

2013-02-17 Thread Noel Garwick
Isn't Renpy's codebase pretty divorced from pygame these days?
On Feb 17, 2013 4:53 PM, "Al Sweigart"  wrote:

> I guess by "professional quality" I would say a game that could reasonably
> be put on Steam for sale in its current state.
>
>
> On Sun, Feb 17, 2013 at 5:26 AM, Cat  wrote:
>
>> Do Ren'Py games count as Pygame, because Ren'Py is based on Pygame? The
>> site http://www.renpy.org lists over 400 games. I've only played one so
>> far, Magical Diary (it's included in Steam Linux promotion) and can confirm
>> that it looks 100% professional and very polished.
>>
>>
>> On 02/17/2013 12:35 AM, Al Sweigart wrote:
>>
>>> Hi everyone, I'm compiling a list of professional-quality games made
>>> using
>>> Pygame. These don't necessarily have to be commercial games, but games
>>> that
>>> have a professional level of quality.
>>>
>>> So far, I have:
>>>
>>> * Dangerous High School Girls in Trouble
>>> * Frets on Fire
>>> * Metin2
>>> * Galcon
>>> * PyDance
>>> * SolarWolf
>>> * División Especial de Detectives
>>>
>>> Are there any others? Or have I added some games to this list
>>> erroneously?
>>>
>>> -Al
>>>
>>>
>>
>


Re: [pygame] Alternate to graphics modules

2013-02-08 Thread Noel Garwick
True.  Still, some might see a distinction between the compiler taking code
that a human has made, breaking it down and optimizing the calls into
operations, and then assembling that vs. using python to make calls to
functions written in python that call functions that someone else has
written in C.

Of course, all of this is just academic (vaguely :p).  The cool thing about
this thread is that Elias' request was not met with "use C, n00b", ">
suggesting python should be used for low level ops..", or even just
silence.  Instead, pygame-users explained the logical issues with the
request (that the OP likely wasn't aware of), and explained why the request
becomes more of a question of semantics than anything else. As well, they
offered suggestions for what could qualify as the next closest method to
fulfill that request.  That is cool.

But yeah:  If you want to use python's syntax to work with low-level
graphics calls, the modules with low-level bindings can offer a pretty
direct 'middle man.'  If you want to write C to use the libraries those
wrap directly, that's a possibility (and not as hard as it looks at first.)
 Or if you really want to get into it (mostly just useful for education,
but we wouldn't be here if pedagogy wasn't of some interest), try out some
assembly.  You will need to emulate an older set of hardware, since as far
as I'm aware things like 0x13h mode don't exist anymore, and as far as I
know most APIs to directly access a graphics card are going to be in C (if
I'm mistaken here, someone please correct me.)

If your overall goal is to get a better understanding of how graphics and
programming in general work, doing a small project in each of these
languages in order could be pretty enlightening (this is how it 'clicked'
for me, at least) -- tutorial links included:

1. Pygame ["Okay, so I take input, then I update the values from that
input, and then I draw.. I guess that's easy enough?]
http://inventwithpython.com/

2. 6502 Assembly (NES) [Registers, memory management, reading/writing to
ports/specific addresses, what loops, containers, and other things we take
for granted actually look like, etc.]
http://www.nintendoage.com/pub/faq/NA/nerdy_nights_out.html

3. C [Working directly with C and SDL or OpenGL calls]
http://www.lazyfoo.net/SDL_tutorials/ (SDL)  && 

4. C/Pygame ["Now that I understand how all that boilerplate works, I can
feel comfortable using 'shortcuts', since I see the benefits they really
offer (so now the only benefit of rolling my own is going to be '..just
'cause' 95% of the time), and can foresee/avoid the things that could cause
bottlenecks. Or I can use C since I want to experiment with designing more
complex 3d shaders, physics, etc. Or just because I think it's fun to use
C."]

[Sorry for the wall of text; hopefully it's helpful]



On Thu, Feb 7, 2013 at 11:20 PM, Julian  wrote:

> On 02/07/2013 10:06 PM, Ian Mallett wrote:
>
>> The point is that you need to go through some kind of middle layer.
>> Python code, by definition, does not interface directly with anything--you
>> must go through some library/package--whether it is a built-in within
>> Python's runtime, a 3rd-party distribution, or a wrapper you make around
>> existing C functionality.
>>
>
> Well, if you want to get really technical, only machine code interfaces
> directly with anything. C abstracts this so your code can work on more than
> one type of processor. Even assembly languages abstract a little bit, if
> I'm not mistaken, though it's pretty direct.
>


Re: [pygame] [Pygame] Smooth Animation

2012-11-22 Thread Noel Garwick
Hey, OP, you may want to read and/or outright use this library:
http://inventwithpython.com/pyganim/index.html

It has a partially written tutorial, but rather helpful examples.


On Thu, Nov 22, 2012 at 4:11 PM, Greg Ewing wrote:

> yannisv wrote:
>
>> Yes, I am. The problem is when I set the FPS to ~12, and use
>> clock.tick(FPS)
>> inside the loop, that movement looks terrible (as expected). When I set
>> the
>> FPS to 30 or 60, the movement does look better, but the frames change
>> extremely fast.
>>
>
> If you want smooth animation, you will need to create more
> animation frames. There's no way around that.
>
> --
> Greg
>


Re: [pygame] Pygame for Android question: videos possible?

2012-11-01 Thread Noel Garwick
I think that devs are waiting for the next version of SDL before they
implement it.  You could always do it manually; blit a series of images to
a surface, while playing the soundtrack using pygame's mixer module.  I did
this (using ffmpeg to extract still frames / audio track, along with a
script to try and remove redundant frames to reduce file size) to get some
renpy games working on android and it worked pretty well.

On Thu, Nov 1, 2012 at 12:32 PM, Alec Bennett  wrote:

> On Mon, Oct 29, 2012 at 3:29 PM, Noel Garwick wrote:
>
>> As far as I know, video support is still missing for Pygame subset for
>> Android.
>
>
> Can anyone think of a way to work around this issue? Maybe a way to play
> video as an external process?
>
> Or would it be hard to add video support to the Pygame subset for Android?
>
>
>
>
>


Re: [pygame] Pygame for Android question: videos possible?

2012-10-29 Thread Noel Garwick
As far as I know, video support is still missing for Pygame subset for
Android.

On Mon, Oct 29, 2012 at 4:28 PM, Alec Bennett  wrote:

> I need to do an Android project that simply plays one of five videos, and
> I was considering using Pygame for it.
>
> I was wondering if this would be possible? Can I play fullscreen video
> using Pygame on Android?
>
> I'd be using the Google Nexus 7, if that's a factor.
>
> The video can be in whatever format is required.
>
>
>


Re: [pygame] GUI toolkit for Pygame using pgs4a

2012-10-29 Thread Noel Garwick
I like the SGC toolkit.  It has nice examples, for one.  However, I've yet
to test any of these on Android.  You'll have to let us know how it works
out.

On Mon, Oct 29, 2012 at 4:09 PM, Brian Bull  wrote:

>  Hello list
>
> I am writing a dungeoneering game in Pygame. I have already written the
> main part of the game, where all the action happens, but now I need to add
> an interface for equipping and levelling your character, choosing which
> dungeon to explore, etc.
>
> I think this means I need a GUI toolkit, with all the standard features
> like lists, choosers, scrollbars, radio buttons, and the ability to combine
> these items into arbitrary layouts. It should be flexible, easy to use and
> look nice.
>
> There are several toolkits available, I need to choose what toolkit to use
> and I would appreciate any suggestions from the list. (I should say I have
> written to the list before to ask the same question, but (a) I now have a
> clearer idea of what i want and (b) I suspect at least one of the available
> toolkits has developed a great deal since I asked last.)
>
> Options I have already identified are:
>
> SGC (http://program.sambull.org/sgc/)
> OcempGUI (http://www.pygame.org/projects/9/125/)
> PGU (http://code.google.com/p/pgu/)
> Albow (http://www.cosc.canterbury.ac.nz/greg.ewing/python/Albow/)
> DavesGUI (http://www.burtonsys.com/python32/DavesGUI.zip)
>
> It may be relevant that I am using Pygame Subset for Android (pgs4a,
> http://pygame.renpy.org/). I would hope that any toolkit that worked for
> 'normal pygame' would work just as well on pgs4a, but I may be
> over-optimistic.
>
> Best regards
> Brian
>


Re: [pygame] Pygame GUI 0.1.9rc

2012-09-07 Thread Noel Garwick
Sam-

This looks very promising!  I did want to note though that the using
current build script will cause two of the examples (helloworld.py and
custom_widget.py) to throw an error:

Traceback (most recent call last):
  File "helloworld.py", line 1, in 
import sgc
  File "build/bdist.linux-i686/egg/sgc/__init__.py", line 24, in 

I've attached a setup.py that adds composite and _interface to the build
path to fix this.

Thanks,
Noel

On Fri, Sep 7, 2012 at 8:01 AM, Sam Bull  wrote:

> This is the release candidate for the 0.2 stable release. Last call for
> testing before the stable release.
>
> This release fixes a few bugs mostly to do with scrolling and the scroll
> handles.
>
>
> To try it out, download the release code. As long as you
> have Python 2 and Pygame installed, you should be able to run the
> example files immediately.
>
> To use it in your own projects, simply copy the 'sgc' sub-folder into
> the top-level of your project or use setup.py to install it system-wide.
>
> Please check it out at:
> https://launchpad.net/simplegc
>
> You can check out the documentation at:
> http://program.sambull.org/sgc/
> If you'd prefer an offline Devhelp version, there is a separate download
> on Launchpad.
>
> I'd appreciate any feedback on the project or the documentation, and any
> problem areas. If you find a widget you need missing, try creating it
> yourself; if you then send it to me, I may include it in the next
> release.
>
> Limitations still in this release:
> Python 3 still not tested.
>
>


setup.py
Description: Binary data


Re: [pygame] Re: HELP PLEASE: sprite collision - object not iterable error

2012-02-21 Thread Noel Garwick
Hey I'm on my phone so I can't see the example you need help on  
specially, but here is some general help on the subject:

Arguments are the variables passed to a function.

Example:

def getDogYears(name, age, canine=False):
if not canine:
age *= 7 # age times 7
return "%s is %s years old in dog years." % (name, age)

>> samsDogAge = getDogYears('Sam', 5)
>> print samsDogAge
>> "Sam is 35 years old in dog years."

In this case, the arguments for the function getDogYears() are:
-name
-age
-canine (optional)

So the "second argument" would be the subject's age. Also note that by  
using "canine=False", we have set an optional argument. This means  
that, if no 3rd argument is given, the function will automatically set  
the variable to it's assigned default value. (In this case, 'False')


Hope that helps! :)

Enargy

On Feb 21, 2012, at 9:21 PM, Scott  wrote:


Thanks for your answer - Not sure what you mean by second argument?

stabbingfinger  writes:


Check the docs. The second argument must be an instance or subclass  
of Group.


Cheers.
Gumm







Re: [pygame] pygame performance limits

2011-11-23 Thread Noel Garwick
Ren'py actually requires more memory than you would think.* The ease  
of use and robust feautures outweigh this though. The most intensive  
things for a visual novel would be if you wanted to use some particle  
effects or something. Honestly the jedit editor it comes packaged with
seens to tax old machine more than any of the actual games made with  
Renpy :p



*as in, according to PyTom (the dev) you couldn't do a direct port of  
Renpy to the NDS. Most PCs from the past decade, or reasonably powered  
Android phone, or cracked Nook, etc can run at least the normal stuff  
fine. At least in my experiences.


Noel


On Nov 23, 2011, at 11:52 AM, Christopher Night  
 wrote:


I don't know why you would be concerned about performance in a  
visual novel game. Aren't they pretty undemanding? I haven't played  
these games very much, but isn't it just a series of still images  
(no animations) and a simple GUI?


You might want to look at a pyweek entry called Gregor Samsa. I know  
that team put some effort into optimizing things and wound up with a  
respectable framerate even on mobile devices running Android:

http://www.pyweek.org/e/tihoas/

But again, I feel like performance is the least of your concerns if  
that's your kind of game. If there's some specific thing you're  
expecting to cause low performance, maybe you can ask about it  
specifically.


Good luck!
-Christopher

On Wed, Nov 23, 2011 at 11:46 AM, Nick Arnoeyts > wrote:

Alright. Thanks for your reply everyone.

I'm currently still working on a Ren'py project, but I'm probably  
going to try pygame once that's finished. I'm mostly making visual  
novels, though, so it's possible that I'm staying with ren'py until  
I reach its limits.


yours truly
armornick


2011/11/23 stabbingfinger 
Hi, Armor Nick.

Some common bottlenecks I've encountered:

rendering many images per frame
brute force collision checking
computationally intensive logic and AI
real-time image transformation
heavy usage of images with SRCALPHA
2D and 2.5D layering
particles

These are easy limits to hit early on especially in scrollers,  
platformers, and bullet hell type games, or when you start adding  
environment and GFX.


But there are clever techniques that pygamers have developed to deal  
with them in the form of cookbook recipes, libraries, and modules.  
Many issues can be easily mitigated by selecting a culling technique  
or two to reduce the number of things processed each game loop.


Some people popping into IRC lately seem easily frustrated by these  
challenges, wanting an inefficient workload to just perform well. I  
can understand the sentiment. But I personally get an immense amount  
of pleasure from conquering these challenges. :)


When I started pygame three years ago I was told you can't do a  
scrolling action-RPG: it's too much work for the CPU. Since then,  
computers became a significantly faster and several people have  
produced reasonably impressive action-RPGs, as well as other genre.


For some examples one only has to look among the top places at pyweek.org 
, where pygame competes with the likes of pyglet, cocos2d, and  
rabbyt, all of which have the proclaimed advantage of 3D  
acceleration. It's become clear to me that for most hobby games the  
only real limitation is the resourcefulness of the programmer.


I personally haven't yet hit a wall with Python or pygame that  
forced me to look at another framework or a natively compiled  
language, and I've done a few relatively ambitious projects.


That may seem like a biased representation of Python's and pygame's  
capabilities, but I assure you it's not. A few times a year my eyes  
wander to other game development libraries or engines, but I keep  
coming right back to pygame.


Hope that perspective helps.

Gumm


On Wed, Nov 23, 2011 at 6:08 AM, Chris Smith   
wrote:
You can use Renpy for graphic novels. SNES RPG's would be no  
problem. For AI and other things, python might be slow but you will  
probably be surprised how far you can go with it. It'll certainly be  
easier than going the C++ route (although I'm not a C++ fan, to be  
honest... I'd use Lisp if I needed the code to be faster).



On 23 November 2011 21:47, Nick Arnoeyts   
wrote:
I'm actually not quite sure what I'm going to write yet. Either an  
RPG in the style of SNES-era Final Fantasy, or a visual novel (if  
you know Higurashi or Clannad). I'm not (yet) interested in 3D and I  
would certainly do something like that in C++.


Pygame is probably fast enough for the graphics, but I was wondering  
how performance would be for AI and other calculations.


yours truly
armornick

2011/11/23 Chris Smith 
You can't really compare the language C++ with the library Python.

You could compare C++ / SDL with Python / Pygame, and probably C++  
would be faster (but maybe by not as much as you think)... but it  
would certainly take a lot more time to write the code.


As to what you can do with Pygame, well it is a

Re: [pygame] Sprite examples with images

2011-04-11 Thread Noel Garwick
You should be able to just use any image with the same dimensions as the one
in the example (using a different size can affect how the game behaves
depending on how it uses calls).

A good example that provides images though, can be found here:

http://inventwithpython.com/chapter20.html

(The images themselves are here) http://inventwithpython.com/resources

On Mon, Apr 11, 2011 at 9:13 AM, ANKUR AGGARWAL wrote:

> Hey
> I am reading pygame and made out simple snake game as a practice. Now want
> to get started with the world of sprites. I looked for the examples but most
> of the examples are without the real images so unable to run them and know
> their functionality. Can anybody send me the links of good examples of
> sprites where images are also available so that i can get a better
> understanding. Thanks in Advance :):)
> Ankur Aggarwal
>


Re: [pygame] New Apple and MS stores. Pygame support?

2010-10-25 Thread Noel Garwick

Do any of the py2java apps support pygame? Is that possible?

I'm still new to all this so Im not sure how/if modules are supported  
in these conversion programs.


On Oct 25, 2010, at 7:36 PM, Dan Ross  wrote:

I don't think so, no. I was just curious if you had tried since. I  
haven't

heard of anyone doing it either.

Personally, I wouldn't know where to start...


On Mon, 25 Oct 2010 16:34:32 -0700 (PDT), Keith Nemitz >

wrote:

No. I don't even know of any pygame iOS apps. Was it even possible

before

Apple changed the rules about interpreted code?



--- On Mon, 10/25/10, Dan Ross  wrote:


From: Dan Ross 
Subject: Re: [pygame] New Apple and MS stores. Pygame support?
To: pygame-users@seul.org
Date: Monday, October 25, 2010, 4:28 PM
I'm awfully curious about this as
well.

Keith-

Have you made any pygame games for an iOS device?

Dan

On Mon, 25 Oct 2010 14:48:01 -0700 (PDT), Keith Nemitz

wrote:

With Apple announcing a new Mac App Store, and MS

announcing a new Games

Marketplace, I wonder how that will affect my Pygame

tool chain.


Will py2app need changes, so I can insert Apple

Certificates into the
app?



Will py2exe need updates to survive the Windows 7

compatibility test?


Inquiring mind wants to know...

:-)

Keith Nemitz
www.mousechief.com




Re: [pygame] Ghosting

2010-08-08 Thread Noel Garwick
Most new laptops can switch between different profiles: one to help save
battery, another to maximize performance, etc.,  One of the ways it does
this is by adjusting the min/max CPU usage.  You may want to try messing
around with that in your Power Settings.

On Sun, Aug 8, 2010 at 8:50 PM, Dan Ross  wrote:

>  I've never had any on my MacBook Pro.
>
>
> On 8/8/10 7:49 PM, Mark Reed wrote:
>
> Is there a ghosting problem with laptop screens that isn't there on
> desktop screens? I just have a laptop available to me right now, and
> any game I have with moving objects is bothering me with this ghosting
> effect behind the images.
>
>