Mario clone

Reply

Join Date: Sep 2008
Posts: 369
Reputation: tomtetlaw is an unknown quantity at this point 
Solved Threads: 4
tomtetlaw's Avatar
tomtetlaw tomtetlaw is offline Offline
Posting Whiz

Mario clone

 
0
  #1
Dec 4th, 2008
Hi all!
Im making a mario clone, and i was wondering how to write the jump function in the Mario class, any help would be good, im using PyGame by the way. heres my code so far:
  1. #usr/bin/env python
  2. import sys
  3. import os
  4.  
  5. import pygame
  6. from pygame.locals import *
  7.  
  8. class Mario():
  9. def __init__(self):
  10. self.image, self.rect = pygame.load_image('mario.png')
  11. self.health = 1
  12. self.alive = 1
  13. def walkRight():
  14. self.move()
  15. def walkLeft():
  16. self.-move()
  17. def jump():
THanks
...
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 670
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Mario clone

 
0
  #2
Dec 4th, 2008
Well what idea's do you have for writing a jump function. I guess you would have to think about a couple of things, What exactly is your motion path when you jump, how the direction of movement before hand effects the mothion path of the jump. Also you would need a method of checking whether or not you have landed/collided with another object.

Chris
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 369
Reputation: tomtetlaw is an unknown quantity at this point 
Solved Threads: 4
tomtetlaw's Avatar
tomtetlaw tomtetlaw is offline Offline
Posting Whiz

Re: Mario clone

 
0
  #3
Dec 5th, 2008
The motion path would be like 70 or so pixels upwards, The direction of movement would be decided on the deriction that mario is moving, and the method for detecting collisions would be something like pygame.colide_get_rect() i think thats the name of that function.
...
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 670
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Mario clone

 
0
  #4
Dec 6th, 2008
So your set and know what you are doing. Trying coding something then coming back with specific problems

Chris
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 369
Reputation: tomtetlaw is an unknown quantity at this point 
Solved Threads: 4
tomtetlaw's Avatar
tomtetlaw tomtetlaw is offline Offline
Posting Whiz

Re: Mario clone

 
0
  #5
Dec 6th, 2008
Ok, will do
...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC