0

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:

#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():

THanks

2
Contributors
4
Replies
6
Views
9 Years
Discussion Span
Last Post by tomtetlaw
0

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

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.