Computer Science Canada Mario game help |
Author: | neufelni [ Wed Jan 11, 2006 1:53 pm ] |
Post subject: | Mario game help |
I am making a Super Mario game and I need some help. How do I get it so that Mario falls when he runs off an object. I have tried doing this but then Mario always falls completely off the screen as soon as the program starts. |
Author: | jamonathin [ Wed Jan 11, 2006 2:51 pm ] | ||||
Post subject: | |||||
This code is just a disaster man. Your 2d array should be in some kind of text file. Also when you're making that text file dont use only number, use letters as well, even symbols. That way your 2d map is legible and doesn't get distorted with double digit numbers.
see how hard that is to line up? Times that by 20 (i.e. your program in the future) Secondly, fix that 1000 chr long exit when x 2, that is inside a proces'd loop. Ditch the process, they'll crap you over. Change them to normal procedure. Just use the process to play music. Lastly get rid of getch, use only Input.KeyDown, there's not real point for getch with this if ur usin Input. Not to rip on your program, but this coding is gonna get ugly real fast. Oh, and here's your solution (ur prolly gonna slap urself)
Put that somewhere, then put " fall " somewhere in ur loop. |
Author: | neufelni [ Thu Jan 12, 2006 12:02 pm ] |
Post subject: | |
How can I shorten that long exit when line? |
Author: | jamonathin [ Thu Jan 12, 2006 1:39 pm ] | ||
Post subject: | |||
Try and figure it out first, before you copy and paste the below code, but what you should do is assign those numbers to an array (the numbers that tell you when to exit loop) and have a for loop run through those numbers, and if that condition matches the number, bam, ur done. Now im not sure how much this slows down ur program (shouldn't) but for some reason your program is runnign really slow on this comp (schools), but anyways, try it out first, then if u give up use the code.
|