| | |
Mario clone
![]() |
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:
THanks
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:
python Syntax (Toggle Plain Text)
#usr/bin/env python import sys import os import pygame from pygame.locals import * class Mario(): def __init__(self): self.image, self.rect = pygame.load_image('mario.png') self.health = 1 self.alive = 1 def walkRight(): self.move() def walkLeft(): self.-move() def jump():
...
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
Chris
Knowledge is power -- But experience is everything
![]() |
Similar Threads
- Free super mario game! (Geeks' Lounge)
- trojans...now nothing opens and I get a paint can't open error (Viruses, Spyware and other Nasties)
- Aurora Trouble... please help I cant delet it (Viruses, Spyware and other Nasties)
Other Threads in the Python Forum
- Previous Thread: Yet another pygame help thread
- Next Thread: Import error with py2exe
| Thread Tools | Search this Thread |
accessdenied advanced aliased apache application argv beginner bits calling casino change clear command convert corners count csv cturtle cursor def definedlines dynamic dynamically edit event events file float format frange function google homework i/o iframe inches input jaunty keyboard lapse line linux list lists loop matching microphone mouse movingimageswithpygame multiple newb number numbers numeric obexftp output parameters parsing path prime programming projects py py2exe pygame pyopengl python random rational raw_input recursion remote return reverse session signal software sprite statictext string strings syntax tails text threading time tlapse tuple ubuntu unicode unit urllib urllib2 valueerror variable voip web-scrape whileloop word wxpython





