| | |
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 |
abrupt alarm ansi anti approximation assignment avogadro backend beginner binary bluetooth calculator character cmd code customdialog cx-freeze data decimals dictionaries dictionary directory dynamic error examples exe file float format function gnu graphics gui halp heads homework http ideas import input java launcher leftmouse line linux list lists loop module mouse number numbers output parsing path pointer port prime programming progressbar projects push py2exe pygame pyglet pyqt python random recursion schedule screensaverloopinactive script scrolledtext sqlite statistics string strings sudokusolver sum table terminal text thread threading time tlapse tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable ventrilo wikipedia write wxpython xlib





