Lamonte(Scheols/Demonic) wrote:
that pygame book, its nice, anyone learn anything new?
Oh yeah, I was going to get that! Thanks for mentioning it. It took a
while to come out!
(your code worked up into a program), and wave the mouse back and
forth to change the angle.
Odd, huh? It's a tricky bit, apparently. The only hits I found on the
internet were for software patents I didn't understand.
--Kamilche
import pygame
import math
filename=rC:\Documents and Settings
Well, that was interesting, but also didn't work. It's similar to my
attempt of tiling then rotating then cutting a piece out of the middle.
I've modified the code to show what happens when that tile is tiled.
Interesting, tho!
--Kamilche
import pygame
import math
filename=rG:\Incarnation
.
Do you spot a mistake in the app I posted?
--Kamilche
.
I see that the problem is a lot more complex than I thought, and I don't
have a handle on how to do it.
Does anyone know how to perform such a task?
--Kamilche
Well, basically, I want to take a picture, rotate it 15 degrees, and use
some algorithm to jam all the pixels lying outside the bounding box back
inside the box, and have the result be tilable.
I thought it should be possible, but it's a thornier problem than I
realized.
--Kamilche
title so it comes up in future searches!
I also enjoyed it.
--Kamilche
Julia wrote:
Awesome code Kamilche. I really like it. I'm going to put it in my
favorites folder :)
Thanks, glad you enjoyed it! I should probably mention I was inspired to
create this code after reading an explanation of one point perspective
at this site:
http://www.olejarz.com/arted
Here's a perspective test I wrote, that I thought others might find
enjoyable. It illustrates a single-point perspective (a 'vanishing
point'), and shows how a room with a floor, ceiling, door, and avatar
changes as the vanishing point changes.
import pygame, os, sys, urllib
SCREENSIZE
I just posted an example on comp.lang.python about how to control the
Microsoft Genie agent using Python, if you are interested.
--Kamilche
Ian Mallett wrote:
That is an interesting effect...
Thanks for sharing!
I don't think that could be adapted to a game very well though.
Ian
You could have the genie do tts on all the chat stuff, mainly. Other
than that, not much application.
pygame was receptive to other people's ideas. I've
submitted improvements to the examples before, and added features like
cross-platform 'full screen mode', but they never got put into the
software.
I'll take another look at pygame ctypes later today.
--Kamilche
Bo Jangeborg wrote:
Kamilche skrev:
Luke Paireepinart wrote:
Also - I was trying to make DLL's for Python in the past, and
discovered the gnarly 'must have the same compiler Python was
compiled with' error. Is that gone with Python 2.5?
Basically - if I go to the effort of making
Marcus von Appen wrote:
On, Thu Jan 24, 2008, Kamilche wrote:
Bo Jangeborg wrote:
[...]
What's stopping you from joining the developers ? It's a collaborative
effort of volunteers as far as I know.
Bo)
I tried. I submitted some changes, some code samples, went to a Thursday
online
Marcus von Appen wrote:
too.
It's still not released ;-).
But don't you want beta testers? ;-)
Put it under a heading of 'beta' - that'd be good. We all know that
means 'use at your own risk.'
--Kamilche
version.
If it's still not available, what have people migrated to for their
Python 2.5 game development? Are they using ctypes with SDL, or something?
--Kamilche
Patrick Devine wrote:
On Jan 23, 2008 9:59 AM, Kamilche [EMAIL PROTECTED] wrote:
If it's still not available, what have people migrated to for their
Python 2.5 game development? Are they using ctypes with SDL, or something?
I thought everyone was using Pyglet now. :-D
-pdev.
Well, I'm
intricacies and dependency on Pygame. If anyone's
interested, I can post the example I've made when I get back home tonight.
--Kamilche
in that area, I'd appreciate hearing them.
--Kamilche
Marcus von Appen wrote:
On, Tue Jan 22, 2008, Kamilche wrote:
[Unhappiness about the existing GUIs]
It's interesting to see that a lot of people tell some public
list/forum/whatever how unhappy they are with existing solutions, but do
not dare to get into touch with any of the solution
Patrick Mullen wrote:
For a toolkit that can only be used in pygame, ignoring things like
pyopengl, python-ogre, etc, such limited use I don't see as being very
marketable. If it was generalized, and pluginable to almost any
python program, that starts to have some real value.
True - being
Marcus wanted an example of how events could be handled better.
I've worked up an example of how the mainline code could look, if the
event handling were done using a more VB-like structure.
import kamgui
# This example creates a screen with 2 buttons and 3 labels.
#
DR0ID wrote:
Hi
def CalculateDistance(a, b):
x, y, z = b[0] - a[0], b[1] - a[1], b[2] - a[2]
dist = x*x + y*y + z*z
return dist * dist
no offense, but x*x + y*y + z*z is already the distance squared, so
no need for return dist*dist. (or did you do this on purpose?).
~DR0ID
Worked this up today for myself, thought I'd post it in case someone
else found it useful.
import pygame
def CenterOfTriangle(A, B, C):
return (A[0] + B[0] + C[0])/3.0, (A[1] + B[1] + C[1])/3.0, (A[2] +
B[2] + C[2])/3.0
def CalculateDistance(a, b):
x, y, z = b[0] - a[0], b[1] -
Lots of people forget to put 'pygame.event.pump()' in the main loop. Try
that, see if it stabilizes.
with IDLE, also call 'pygame.event.pump()' every
time through the main loop. Between that and calling 'pygame.quit()' at
the end, all works fine.
--Kamilche
Ian Mallett wrote:
By code I mean any program that works otherwise, by it crashes I mean I
have to quit using the taskmanager and endtask, and by how I quit I mean
keystate = pygame.key.get_pressed()
for event in pygame.event.get():
if event.type == pygame.QUIT or keystate[K_ESCAPE]:
Ian Mallett wrote:
My name is Ian. The full story on this is that I sent the message from
my computer and then it sent a reply email saying it didn't work. I
sent my message to my friend, Ken, who is also on the mailing list to
see if he could get better results. As soon as he had sent my
Kris Schnee wrote:
What's different about the tavern versus a regular room? Most likely
it's just some variables that you might as well put into a single Room
class. For instance, if a room can be light or dark, you could give the
Room class a light variable by putting in the __init__
Will McGugan wrote:
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
On Thu, June 7, 2007 2:45 pm, Horst JENS wrote:
On Mon, 2007-06-04 at 21:19 +0100, Will McGugan wrote:
I've just posted some sample code for using OpenGL with PyGame. Hope
you find it interesting.
DR0ID wrote:
nice!
Some comments would be appreciated. Is it an affine transformation? The
hit test look like raytracing code; how does it work?
Well, no can do - I'm looking stuff up in books and online, and barely
understanding this myself. For instance - you must specify the
Here's a program that will map points from one quadrilateral to another
quadrilateral:
import pygame, math
WIDTH = 800
HEIGHT = 600
BLACK = ( 0, 0, 0, 255)
WHITE = (255, 255, 255, 255)
RED = (255, 0, 0, 255)
YELLOW = (255, 255, 0, 255)
BLUE= ( 0, 0, 255, 255)
Brian Bull wrote:
Hi,
My Pygame app runs fine in windowed mode, using
pygame.display.set_mode((1024,768))
But when I switch to fullscreen mode with
pygame.display.set_mode((1024,768),pygame.FULLSCREEN)
the display looks fine but the app speed slows down dramatically. Perhaps the
.
If that still doesn't do it for you, try turning the volume down to .5
on the channel.
--Kamilche
is a little worse than Windows Media Player, but at
least it's not grating to the ears any more.
--Kamilche
your blog. :-)
--Kamilche
. You've obviously got the maths to do it. ;-)
--Kamilche
that you enjoy juggling technology
women. I'm a technology woman - but you'd have to find 2 others before
you could juggle us. ;-)
--Kamilche
, I throw all away except the first one. If you wanted to
be more accurate, you should probably throw away all except the LAST
movement. That way you're always guaranteed of being up to date.
--Kamilche
they've developed in the past as part of their project.
Just my 2 cents worth. I'd be happy to see your online game in the
competition, as long as you included the source code. :-D
--Kamilche
, and
ensuring YOU will never receive any support from people who read this
mailing list.
--Kamilche
Well, thanks for the info. I thought as much. I think I'll give it a
miss - I don't need it badly enough to require OpenGL to be included as
well.
--Kamilche
V. Karthik Kumar wrote:
I happened to read the changes list a day ago. I saw the code, I thought
that this change might help detect regular pp cols faster.
This version keeps checking pixels from the outer rectangle of the
colliding area to the inner. It works considerably faster when objects
Kris Schnee wrote:
Kamilche wrote:
Try the following code. It uses a gradient light.
I'm trying to figure out how your example (much better than mine) works.
It looks like the key is the last line of this function:
def RefreshNight(night, alpha, light, x, y):
a = NIGHTCOLOR[3
a pygame image
load. The speed bump truly surprised me!
--Kamilche
Luke Paireepinart wrote:
Kamilche wrote:
Bob Ippolito wrote:
That doesn't seem to make any sense... you've already loaded the
picture, why convert it to a string just to convert it back to a
picture? It's using up about the same amount of RAM as a string or as
an image object.
Assume
the animations for a script, or load them in a
separate thread, or something.
--Kamilche
else tho! (Someone that
doesn't need 256 color images.)
--Kamilche
Aaron Maupin wrote:
Not sure if this is connected, but when I was working on a Pygame
project with text input, it didn't detect my Japanese keyboard. It
seemed to treat it like a standard U.S. keyboard. For example, if I
pressed SHIFT-2, I got an @ instead of the correct .
I was using
:
print event.key
I noticed that event.key is 0 when I press that key.
Any ideas on what is going on?
Thanks,
Conrado
Yeah, I have keyboard bugs too. For one guy, the shift key registers as
0. For me, I can't hit the print screen plus some other keys.
--Kamilche
Rikard Bosnjakovic wrote:
On 12/28/06, Kamilche [EMAIL PROTECTED] wrote:
Sure, here it is. It's a total hack using global variables, but it
works. Numeric takes 1 second, numpy takes 2.6, doing the same
operations to the same picture.
On line 30, array = pygame.surfarray.array3d(pic2).astype
to use numpy, if you have to convert to/from Numeric arrays to
get it to work right anyway.
--Kamilche
def TestNumpy():
global pic2
pic2 = GetPic()
print 'numpy version: %s' % numpy.__version__
array = numpy.array(pygame.surfarray.pixels3d(pic2).astype(numpy.int))
alphaarray
Jakub Piotr Cłapa wrote:
Kamilche wrote:
I make heavy use of Numeric in my sprite engine.
When I did the following, I was able to 'drop in' numpy as a
replacement, but it took 3x longer to load my complex graphics! :-O
Maybe you could offer a reduced test case so we could check this? I'm
Patrick Mullen wrote:
Rotate will distort the image as well, unless you rotate in 90 degree
increments. Make sure to always rotate based on the source, and not off of
previous frames of the rotation. Rotate is unfiltered, and won't look as
good as rotozoom; rotozoom is slower I believe.
Luke Paireepinart wrote:
Jasper wrote:
Brian Fisher wrote:
On 12/25/06, Jakub Piotr Cłapa [EMAIL PROTECTED] wrote:
AFAIK you ought to switch to numpy (which is maintained). ;-)
According to the people behind numeric, users ought to switch to NumPy
as quickly as possible
see the Older Array
I make heavy use of Numeric in my sprite engine.
When I did the following, I was able to 'drop in' numpy as a
replacement, but it took 3x longer to load my complex graphics! :-O
try:
import numpy as Numeric
Numeric.Int = Numeric.int
Numeric.Float = Numeric.float
Numeric.UInt8 =
are in PNG format.
--Kamilche
Pete Shinners wrote:
On Sat, 2006-12-23 at 12:10 -0800, Kamilche wrote:
In the SDL documentation, it says under 'SDL_SetAlpha':
When blitting RGBA-RGBA with SDL_SRCALPHA: The source is alpha-blended
with the destination using the source alpha channel. The alpha channel
in the destination
to develop your own engine, which it sounds like you don't want
to do), or to look at pre-built 3D engines that have Python bindings.
--Kamilche
Simon Oberhammer wrote:
mh.. couldnt find screenshots, but the NPCs look nice indead :-)
They're all under the 'forum' link.
Richard Jones wrote:
On Saturday 25 November 2006 06:52, Simon Burton wrote:
I put up a cookbook entry on how to alias a cairo surface
to a pygame surface (and a numpy array):
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498278
Could you please put it in the pygame cookbook?
Farai Aschwanden wrote:
Do you send it over the IP adresses? How you surpass firewalls and NAT?
Am 24.11.2006 um 21:28 schrieb Kamilche:
Farai Aschwanden wrote:
Really great work! Also my compliments and respect to the GFX artist.
;) You pushed the game level of Pygame definately higher!
One
I have a question - Do you know of a way to get method 3 as outlined
below to be faster? The necessity of doing all those extra blits to
preserve the alpha channel is really slowing things down.
import pygame
WIDTH = 800
HEIGHT = 600
bg = None
def Init():
global bg, font
Luke Paireepinart wrote:
Now just add little splashes at the bottom, a rain sound effect, and
randomly change the background to white for a few frames (to simulate
lightning)
and you can sell it as a screensaver!
I'm excited :D
Glad you find it entertaining! :-D
Uh, BTW, that URL was
I was inspired to create a rain generator after seeing someone else's on
the Internet today, and thought I'd post it here:
[code]
import pygame
import random
import time
SCREENSIZE = 640, 480
class Rain(object):
' Rain generator'
drops = []
height = 160
speed = 1
color
Farai Aschwanden wrote:
Nice looking rain and proper code! I experienced a tiny lag like every 3
seconds. I experienced that also in other games/demos, couldnt find out
why. Did other ppl also experienced this and/or knew why or is it only
on my Mac?
Greetings
Farai
Thanks!
It doesn't
of this mini game is
to keep that box at the bottom covered and not let any rain touch it.
Really cute!
--Kamilche
No screenshots! How can I come make a snap judgement of your game if you
post no screenshots? ;-)
Patrick Mullen wrote:
There's some screenshots at the blender forums:
http://blenderartists.org/forum/showthread.php?t=76549page=3
Yeah the web sites still not quite finished. I plan on adding a gallery
and
a forum this weekend.
Maybe I'm not really looking for people who will make snap
in the queue, then render, the same behavior is
exhibited. Even the throttle makes no difference.
--Kamilche
Nelson, Scott wrote:
Ok, theory question about Rects...
I understand how a rect works, but I'm interested in why it works the
way it does to help flesh out my understanding...
Originally, I was playing with code that looked something like this:
r = pygame.display.get_surface().get_rect()
If
is used.
And my question exists further: Why is there no pygame 1.7 for Python2.3?
Am 13.07.2006 17:26:19 schrieb Kamilche:
if sys.platform == 'win32':
os.environ['SDL_VIDEO_WINDOW_POS'] = '3,23'
os.environ['SDL_VIDEODRIVER'] = 'windib'
This doesn't help
it 'in the air' like cloud cover with perspective. I
could 'drag' those tiling bitmaps perspective corrected bitmaps about
and simulate cloud cover, I believe, but I don't want to use OpenGL to
do it.
Does anyone have a Pygame example that does this, without using OpenGL?
--Kamilche
it in the air, so it looks like cloud cover. I could
'drag' those tiling perspective corrected bitmaps about to simulate it
pretty well, I believe, but I don't want to use OpenGL to do it.
Does anyone have a Pygame example that does this, without using OpenGL?
--Kamilche
':
os.environ['SDL_VIDEO_WINDOW_POS'] = '3,23'
os.environ['SDL_VIDEODRIVER'] = 'windib'
Anyways, try commenting out your environ variable settings, see if that
helps... thought that might get you the 'DirectX' engine on older
versions of Pygame.
--Kamilche
, time.
What's the magical incantation to get Numeric to assign the data
directly to the pixels of the surface?
--Kamilche
---
import pygame
import Numeric
import Image
import struct
import math
import os
import sys
pathname, scriptname
Peter Shinners wrote:
On Sat, 2006-07-08 at 20:04 -0700, Kamilche wrote:
Hey Pete, I have another Numeric question for you, if you've got the time.
Let's say I have a bunch of data in RGBA format, where is an
arbitrary floating point number, and RGBA are unsigned bytes
Rikard Bosnjakovic wrote:
On 7/5/06, Kamilche [EMAIL PROTECTED] wrote:
if alpha[x][y] 0:
Strip 0 from that line. That is, change it to if alpha[x][y]:.
Uh, that made it work a lot faster, but I don't know why. :-D It could
still use some speed improvement
Peter Shinners wrote:
Anytime your have nested for x in width: for y in height: expect your
code to be extremely slow. Numeric will be no faster than Python lists
when used this way.
I think the best method is to scan for empty rows and columns. You can
also get the alpha from non-32 bit
Is there a version of Pygame out there compiled for Mac OSX 10.4 Intel
machines? When I try to run my game, I get the following message:
File
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/pygame/__init__.py,
line 75, in -toplevel-
from pygame.base import *
sprites. That way you can have 1000 explosions going off
at once for no memory hit, just a performance hit.
--Kamilche
and fog effects in some of the rooms.
--Kamilche
82 matches
Mail list logo