Re: [pygame] Scrolling
Yanom Mobis wrote: How is scrolling tipicallly done in pygame? I was thinking of creating a large surface, blitting all the game objects to that surface, and then blitting part of that surface to the screen. like this: That's kinda what I do. I blit part of the background directly to the screen and then blit all game objects to the screen. There's no real need for a large intermediary surface. Unless you want to do something like scaling/rotation on the whole thing. Unfortunately it is slow as hell. Depending on the nature of game you could attempt some form of dirty rectangles to reduce the amount of blitting going on, but it's usually not worth it if there's a lot of scrolling going on.
Re: [pygame] Pygame games run slowly :(
Tyler Laing wrote: Lambda/list comprehension executing speed. http://oddco.ca/zeroth/zblog Wow, does doing this really give such a significant speed up? That's awesome, thanks a lot Tyler. Fiona
Re: [pygame] running downloaded games / auto installer
timmcilv...@talktalk.net wrote: Just one more question. Is it possible to package a game written in python with the python language, pygame and an installer that will install the necessary packages on a users computer - the way you would install a commercial game written in C++? I can assure you that with some minor jiggling py2exe[1] works perfectly with PyGame, and I've used it with my last two Ludum Dare entries[2]. Then you can use any old installer builder like the Nullsoft one[3]. Fiona 1- http://www.py2exe.org/ 2- http://www.ludumdare.com/compo/author/fiona/ 3- http://nsis.sourceforge.net/Main_Page -- *Sputnik Internet **¤ * Web Graphic Design, Marketing Illustration 30 King Street Manchester M2 6AZ Tel 0870 742 5959 E-mail: fi...@sputnikinternet.com mailto:fi...@sputnikinternet.com Web: http://www.sputnikinternet.com http://www.sputnikinternet.com/ **
Re: [pygame] Sprite Editor
Yanom Mobis wrote: Do any of you know of a good, free sprite editor I could use to make graphics for my games? It needs to run on Linux. I have had a lot of success using Graphics Gale under Wine http://www.humanbalance.net/gale/us/ It's really the only program I can happily pixel in and runs almost perfectly with Wine.
Re: [pygame] new game
Yanom Mobis wrote: hmmm is there anything where people can download without having to have hg/svn/cvs/git installed? even mercurial doesn't do this. Google Code will let you add downloadable files. Just a shame it's SVN. I prefer git and Github. Github have a little feature called Github pages ( http://github.com/blog/272-github-pages ) that will let you create a mini website in your repo, you could just throw a file in there, link it, and it would work fine as a download. :)
Re: [pygame] Working on Retro 80s Game SDK, Looking for generalsupport
The Music Guy wrote: Yeah, I think I'm going to go with Google code for now. Apparently they use Subversion. Right now I'm using Komodo Edit, which is nice, but it doesn't have support for version control of any kind (not even svn) unless you want to pay ~$300 to upgrade to Komodo IDE. I really don't have that kind of cash. Could you recommend a good IDE that supports svn, preferably a free (as in beer) one? I'm reading about how to use Subversion ATM, but it sounds like things could get awkward rather quickly if my editor doesn't have some kind of integrated svn support. Eclipse with the Subclipse IDE will work fine. If you use Windows you could just use Tortoise SVN (Explorer integration). Although I'm inclined to say that an IDE for version control is completely unnecessary, I know a lot of people need the visual feedback that a console based interface can't necessarily give. If you're happy with text though, I'd personally highly recommend using git for version control, along with GitHub. It's completely golden. Fiona
Re: [pygame] Working on Retro 80s Game SDK, Looking for generalsupport
Fiona Burrows wrote: Eclipse with the Subclipse IDE will work fine. Hurf. I mean the Subclipse plugin. -- *Sputnik Internet **¤ * Web Graphic Design, Marketing Illustration 30 King Street Manchester M2 6AZ Tel 0870 742 5959 E-mail: fi...@sputnikinternet.com mailto:fi...@sputnikinternet.com Web: http://www.sputnikinternet.com http://www.sputnikinternet.com/ **
Re: [pygame] Getting input from command line
Michael wrote: On Monday 01 December 2008 12:57:15 Fiona Burrows wrote: I know this isn't directly related to PyGame but I figured there were worse places to ask a question like this This page is your friend: http://openbookproject.net/py4fun/lode/lode.html#auto2 In fact the entire site is quite fun... http://openbookproject.net/py4fun/ ... but with a name like that it would be. Specifically this file shows you what you need to do: http://openbookproject.net//py4fun/lode/ttyLinux.py Specifically you have to change the console mode to spit out characters at a time, you can then play with them and when your program exits change it back again. Michael. That looks extremely useful, thank you! Unfortunately it's Unix-like only. (At least that's what the Python docs say about termios.) Is there a Windows alternative that you know of? I could just check what the OS is and use the specific routines for the platform. Thanks! Fiona -- *Sputnik Internet **¤ * Web Graphic Design, Marketing Illustration 30 King Street Manchester M2 6AZ Tel 0870 742 5959 E-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Web: http://www.sputnikinternet.com http://www.sputnikinternet.com/ **
RE: [pygame] Getting input from command line
The msvcrt module has Windows console I/O routines, including kbhit() (Section 36.2.2 in the Python 2.5 docs). I don't know of any platform independent console routines in Python. -- Lenard Lindstrom [EMAIL PROTECTED] Yeah it's a shame. For all who replied. Thanks a lot! However, I have just rethought how my program works and decided on a slightly less user friendly, but more cross platform solution using raw_input(). It seems to work pretty well on initial tests. Thanks, Fiona winmail.dat
[pygame] Getting input from command line
I know this isn't directly related to PyGame but I figured there were worse places to ask a question like this. Does anybody know the best way to get input from the command line? Specifically space and escape. I have my program doing things in a thread and constantly reporting information. I'd like the main thread to be able to pause and unpause the other thread on space and to quit program cleanly with escape. I tried using Curses, but it didn't work out too well. I got the input great, but I came across problems when adding strings that went off screen (lol). Rather than try to fix this I finally decided that I didn't want to use Curses since it can't run on Windows. Am I getting into the realm of GUI software here simply by wanting input from space and escape? I just wanted something I could start in a terminal and forget about really. Does anyone have any ideas? Thanks, Fiona
Re: [pygame] Getting input from command line
Knapp wrote: I think I must be missing something. Why don't you just use pygame keys? http://www.pygame.org/docs/ref/key.html I was under the impression that I had to create a window before PyGame would get keys, or is this not the case? I wanted my program to be purely in the terminal.
[pygame] Pygame-Fenix - Using generators as game objects
Hi all, years ago I used to use a tool to make games called DIV Games Studio, when it eventually died I started using it's successor called Fenix. The language that you used to make games was/is an odd mix of C and Pascal. However they had a novel way of creating and handling game objects. Basically everything in the game is a Process, processes are basically objects that run from start to finish, have screen coordinaties, z-depth, a size, an angle, and a graphic among other things. You could define a process like this: process guy(x, y) begin graph = load_png(test.png); loop frame; end end end Everytime your program calls a guy, like you would a function, a new object is created in world independent of everything else. The code for the guy starts at begin, and then gets destroyed when it hits the end. loop creates an infinite loop. The interesting part of how it all works is the frame; statement. When it hits frame, it jumps out of the loop and stops executing till the next frame. There's also routines for distance checking and collision detection between objects. In addition to the aformentioned settings that each process can have it was all very easy to do simple to moderately complex games. Basically DIV/Fenix made me retarded when it came to making games. In other languages it just seemed I had to do so much to achieve what Fenix gave me for free. When I started writing Python I found I loved it, and hated Fenix's syntax and it's constant bugs. So I decided to emulate Fenix in Python/Pygame. The result (thus far) is fenix-pygame: http://code.google.com/p/pygame-fenix/ I found that I can emulate the way the frame; statement works completely by using generators instead. The example code on the front page shows a program that displays an object which has a graphic assigned to it and moves around the screen with the arrow keys. When the code hits yield it jumps out of the function till the next frame. There are a few other simple examples showing process interaction in the repo. I'm not sure if anyone else has used generators for game objects, but it's always seemed so natural to me and I certainly can't stop thinking in processes when I write games. The library is certainly not perfect, there's next to no optimisation done especially in display routines so don't expect anything fast. But the concept is there. I'm going to continue improving it for my own endeavours and will be using it for Ludum Dare this weekend. Hope someone finds it interesting or useful. Thanks, Fiona -- *Sputnik Internet **¤ * Web Graphic Design, Marketing Illustration 30 King Street Manchester M2 6AZ Tel 0870 742 5959 E-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Web: http://www.sputnikinternet.com http://www.sputnikinternet.com/ **
Re: [pygame] Pygame-Fenix - Using generators as game objects
Noah Kantrowitz wrote: If you want to look up information about this, the general term is actor-based programming. Existing libraries (neither of which ever seemed that great) include PARLEY and Dramatis. Stackless tasklets are also a very nice way to handle this. Thank you! I knew there would be a term for it. :) Those libraries seem interesting - especially Dramatis. But neither of them seem as well suited for games as mine as I have lots of game-specific things like collision detection going on. -- *Sputnik Internet **¤ * Web Graphic Design, Marketing Illustration 30 King Street Manchester M2 6AZ Tel 0870 742 5959 E-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Web: http://www.sputnikinternet.com http://www.sputnikinternet.com/ **