Re: [pygame] my first game (so far)

2008-03-18 Thread Michael Fiano
On Mon, 17 Mar 2008 18:50:36 -0700
Lenard Lindstrom [EMAIL PROTECTED] wrote:

 The only thing I 
 wondered about is that changing the direction the sprite faces also 
 makes it moving ahead one square.

This functions how I would like. If the player is facing right,
pressing left will face and move left IF there is a place to move. If
left of the player is blocked, it won't move, but will still switch to
face the sprite left.


Re: [pygame] my first game (so far)

2008-03-18 Thread Michael Fiano
On Mon, 17 Mar 2008 21:53:23 -0700
Patrick Mullen [EMAIL PROTECTED] wrote:

 To Michael, I think you are making a great start with this, and the
 code looks very clean and well designed.  Scrolling the screen can be
 tricky if you have never done it before, but it is not too
 complicated.

Thanks :) I appreciate the explanation and examples of how to scroll
the screen. I'm going to try at it tonight.


Re: [pygame] my first game (so far)

2008-03-18 Thread Devon Scott-Tunkin
ill have to look at it again tonight see if the
controls are on my end (maybe ill also load it up on
my ubuntu partition...), anyone else try this in
vista?  

i have had 2 very odd keyboard control issues in some
non pygame games before, but 2 out of the hundreds ive
played on vista isn't very many.  but it may be a
hardware or driver issue somewhere on my end and
vista.

great start though, ill be excited to see it when its
more done.

Devon

--- Michael Fiano [EMAIL PROTECTED] wrote:

 On Mon, 17 Mar 2008 17:18:46 -0700 (PDT)
 Devon Scott-Tunkin [EMAIL PROTECTED] wrote:
 
  Hey,
  
  I liked the weird american idol like menu song and
 the
  tiles look pretty cool in the graphics file. When
 I
  first ran it and tried to select new game I got a
  pygame.error: music not loaded for the
  pygame.mixer.music.play in scene.py (line 28). i
  commented it out and it started (as i haven't
 worked
  with sound yet in pygame myself to try and fix it
 and
  am just starting oop too). then i was in a field
 of
  all grass with really wonky controls that would
  sometimes not allow me to walk in certain
 directions.
  
  i am using python 2.5 pygame 1.7 and windows
 vista.
  
  But hey at least the guy animates nicely and does
  something!
  
  Devon
 
 Thanks, though the graphics and sounds are just
 place-holders for nowdefinitely not the final
 versions.
 
 As for the music error, this is because I was trying
 to save space with the archive on my web server and
 created a symlink for the menu music to the scene
 musicwhich now that I think about shouldn't work
 on non-nix systems :) As for the wonky controls,
 that I cannot explain. The player can move all over
 the viewable area (no scrolling yet [help?]) for me.
 Anyone else want to try it on Vista, or other
 versions of Windows, or other OS's? It seems to work
 fine on Linux with pygame 1.7.1 and python 2.5.
 
 Anyway, I'm glad you like it so far. I'm quite happy
 with the result so far myself being my first
 OOP/game project and all.
 



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 



Re: [pygame] my first game (so far)

2008-03-18 Thread Patrick Mullen
From: Devon Scott-Tunkin
 anyone else try this in
 vista?

I'm running it in vista, and I did notice the character stop moving a
few times - usually after pressing another key (shift etc).  I was
trying to find the run key, hehe - Character moves a bit slow.  There
may be something wrong in the event handler where it loses the event,
which happens more often on your computer than on mine.


Re: [pygame] my first game (so far)

2008-03-17 Thread Devon Scott-Tunkin
Hey,

I liked the weird american idol like menu song and the
tiles look pretty cool in the graphics file.  When I
first ran it and tried to select new game I got a
pygame.error: music not loaded for the
pygame.mixer.music.play in scene.py (line 28). i
commented it out and it started (as i haven't worked
with sound yet in pygame myself to try and fix it and
am just starting oop too). then i was in a field of
all grass with really wonky controls that would
sometimes not allow me to walk in certain directions.

i am using python 2.5 pygame 1.7 and windows vista.

But hey at least the guy animates nicely and does
something!

Devon

--- Michael Fiano [EMAIL PROTECTED] wrote:

 Hi all. First, I would like to thank this list, and
 the #pygame channel for all the help so far in
 writing my first game, which is going to be a 2D
 RPG. Thank you so much!
 
 I started writing my first game January 1st, and I
 have a long way to go, but I figured I would post my
 progress so far and maybe get some suggestions for
 improvement, or maybe my code can somehow help
 someone else, so here it is:
 

http://onyx.yi.org/sites/onyx.yi.org/files/test.tar_.bz2
 
 I am currently having difficulties figuring out how
 I can adapt what I have so far to scroll the world
 when the player moves near the edges of the screen.
 If you have any ideas, any help would be
 appreciated.
 
 Well, enjoy the code..or don't enjoy it. I actually
 expect a lot of criticism. I'm new to OOP and game
 design.
 



  

Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs


Re: [pygame] my first game (so far)

2008-03-17 Thread Michael Fiano
On Mon, 17 Mar 2008 17:18:46 -0700 (PDT)
Devon Scott-Tunkin [EMAIL PROTECTED] wrote:

 Hey,
 
 I liked the weird american idol like menu song and the
 tiles look pretty cool in the graphics file. When I
 first ran it and tried to select new game I got a
 pygame.error: music not loaded for the
 pygame.mixer.music.play in scene.py (line 28). i
 commented it out and it started (as i haven't worked
 with sound yet in pygame myself to try and fix it and
 am just starting oop too). then i was in a field of
 all grass with really wonky controls that would
 sometimes not allow me to walk in certain directions.
 
 i am using python 2.5 pygame 1.7 and windows vista.
 
 But hey at least the guy animates nicely and does
 something!
 
 Devon

Thanks, though the graphics and sounds are just place-holders for 
nowdefinitely not the final versions.

As for the music error, this is because I was trying to save space with the 
archive on my web server and created a symlink for the menu music to the scene 
musicwhich now that I think about shouldn't work on non-nix systems :) As 
for the wonky controls, that I cannot explain. The player can move all over the 
viewable area (no scrolling yet [help?]) for me. Anyone else want to try it on 
Vista, or other versions of Windows, or other OS's? It seems to work fine on 
Linux with pygame 1.7.1 and python 2.5.

Anyway, I'm glad you like it so far. I'm quite happy with the result so far 
myself being my first OOP/game project and all.


Re: [pygame] my first game (so far)

2008-03-17 Thread Lenard Lindstrom

Michael Fiano wrote:

On Mon, 17 Mar 2008 17:18:46 -0700 (PDT)
Devon Scott-Tunkin [EMAIL PROTECTED] wrote:

  

Hey,



[snip]

then i was in a field of
all grass with really wonky controls that would
sometimes not allow me to walk in certain directions.





Thanks, though the graphics and sounds are just place-holders for 
nowdefinitely not the final versions.

As for the music error, this is because I was trying to save space with the 
archive on my web server and created a symlink for the menu music to the scene 
musicwhich now that I think about shouldn't work on non-nix systems :) As 
for the wonky controls, that I cannot explain. The player can move all over the 
viewable area (no scrolling yet [help?]) for me. Anyone else want to try it on 
Vista, or other versions of Windows, or other OS's? It seems to work fine on 
Linux with pygame 1.7.1 and python 2.5.

Anyway, I'm glad you like it so far. I'm quite happy with the result so far 
myself being my first OOP/game project and all.
  
I tried it with Pygame 1.8 on an older Windows and it works fine. No 
problems with the arrow keys that I could find. The only thing I 
wondered about is that changing the direction the sprite faces also 
makes it moving ahead one square.


--
Lenard Lindstrom
[EMAIL PROTECTED]



Re: [pygame] my first game (so far)

2008-03-17 Thread Patrick Mullen
On Mon, Mar 17, 2008 at 6:50 PM, Lenard Lindstrom [EMAIL PROTECTED] wrote:
  problems with the arrow keys that I could find. The only thing I
  wondered about is that changing the direction the sprite faces also
  makes it moving ahead one square.

Most rpgs I know of work this way, so Michael is working within the
standard.  Although maybe the standard is not so good :)

To Michael, I think you are making a great start with this, and the
code looks very clean and well designed.  Scrolling the screen can be
tricky if you have never done it before, but it is not too
complicated.  The biggest loss with screen scrolling is that (at least
if you are smooth scrolling) dirty rects basically go out the window -
the entire screen becomes the dirty rect when it is scrolling.

The main idea, is to have a camera offset value, and then every time
you draw you subtract that value from the x and y of what you are
drawing.  This way, most of your code doesn't have to be changed, as
you are working with the same coordinates for everything.  The only
code that has to change are the blits.

screen.blit(image,[x,y])
becomes
screen.blit(image,[x-cam_x,y-cam_y])

Test this step of the code, before you worry about scrolling, by
setting the cam_x and cam_y to different values.

Once you have this, you can detect where the player is going to be
drawn (player pos minus camera offset) to determine if the screen
should be scrolled.

Here's some pseudo code for that:
screen_x = player_x - cam_x
screen_y = player_y - cam_y
screen.blit(player,[screen_x,screen_y]
if screen_x(screen_width-100):
   cam_x+=scroll_speed
if screen_x100:
   cam_x-=scroll_speed
if screen_y(screen_height-100):
   cam_y+=scroll_speed
if screen_y100:
   cam_y-=scroll_speed

Then, the camera will scroll when the player is 100 pixels from any screen edge.

This is of course not directly applied to your project, but you should
be able to figure it out.

I hope to see more of this project in the future.  The world can never
have too many rpgs :)


[pygame] my first game (so far)

2008-03-16 Thread Michael Fiano
Hi all. First, I would like to thank this list, and the #pygame channel for all 
the help so far in writing my first game, which is going to be a 2D RPG. Thank 
you so much!

I started writing my first game January 1st, and I have a long way to go, but I 
figured I would post my progress so far and maybe get some suggestions for 
improvement, or maybe my code can somehow help someone else, so here it is:

http://onyx.yi.org/sites/onyx.yi.org/files/test.tar_.bz2

I am currently having difficulties figuring out how I can adapt what I have so 
far to scroll the world when the player moves near the edges of the screen. If 
you have any ideas, any help would be appreciated.

Well, enjoy the code..or don't enjoy it. I actually expect a lot of criticism. 
I'm new to OOP and game design.