Computer Science Canada My take on Mario |
| Author: | DifinityRJ [ Mon Jan 08, 2007 8:09 pm ] |
| Post subject: | My take on Mario |
Hi, im in grade 10 and for my ISU i making a Mario game. This is my first year in programming, and Turing is my first language. Yes, it isn't exactly like Mario, i know. Also it isn't completely done, but i would like some constructive comments on how the game feels, and its fun factor for you. You move with arrow keys and jump with Space. Note: This isn't a sidescroller, its basically rooms. |
|
| Author: | CodeMonkey2000 [ Mon Jan 08, 2007 8:38 pm ] |
| Post subject: | RE:My take on Mario |
Thats pretty good. There are some problems with collisons though. Cant wait to see more updates. |
|
| Author: | DifinityRJ [ Mon Jan 08, 2007 8:41 pm ] |
| Post subject: | Re: My take on Mario |
im using Math.Distance for my collision, is there any better way to do it? |
|
| Author: | CodeMonkey2000 [ Mon Jan 08, 2007 8:48 pm ] |
| Post subject: | RE:My take on Mario |
Well I used my own collision function on my mario game(it's an updated verson of my program here) that checks if two images are colliding. The same function is used for level and enemy collision. |
|
| Author: | DifinityRJ [ Mon Jan 08, 2007 8:57 pm ] |
| Post subject: | Re: My take on Mario |
I havent learnt record or functions or .floor, i dont even know what that is. Pretty much the code doesn't make any sense to me. |
|
| Author: | Clayton [ Mon Jan 08, 2007 9:03 pm ] | ||||
| Post subject: | Re: My take on Mario | ||||
then take a look through the Turing Walkthrough at all of the great tutorials Records: records are collections of data, meaning you can make them hold anything you want, ie:
Functions: Functions are methods that compute new values from arguments passed to it, and return that value, ie:
|
|||||
| Author: | CodeMonkey2000 [ Mon Jan 08, 2007 9:03 pm ] |
| Post subject: | RE:My take on Mario |
you can look at the turing tutorials for info on functions,records and Mario.floor is just a variable (it shows up as a predefied function at school for some reason). I dont get how you are using Math.Distance though. I would just use x,y comparison. |
|
| Author: | Clayton [ Mon Jan 08, 2007 9:06 pm ] | ||
| Post subject: | Re: My take on Mario | ||
sorry, my function code should have been as follows:
sorry for the confusion |
|||
| Author: | DifinityRJ [ Mon Jan 08, 2007 9:11 pm ] | ||||
| Post subject: | Re: My take on Mario | ||||
Here is if Mario hits goomba, gy1 being goomba's y position and gx1 being his x position, and "x" being mario's x position, and "y" being Mario's y position.
Here is if goomba hits mario
This is probably inefficient, but i dont know of any better way. |
|||||
| Author: | Clayton [ Mon Jan 08, 2007 9:16 pm ] | ||
| Post subject: | Re: My take on Mario | ||
even better, change that into a function:
then you can simply call that function in an if statement, and if it's true, change your variable accordingly, or even better, call a procedure to do it for you. |
|||
| Author: | CodeMonkey2000 [ Mon Jan 08, 2007 9:20 pm ] | ||
| Post subject: | Re: My take on Mario | ||
shouldnt it be:
|
|||
| Author: | Clayton [ Mon Jan 08, 2007 9:29 pm ] | ||
| Post subject: | Re: My take on Mario | ||
mine is perfectly legal. In the if statement, an expression has to return a boolean (true or false). Seeing as my function is returning a boolean, we can do away with the if and just return the boolean that would otherwise show up in the if (this only works when there are only two options based on one condition though). EDIT: We can work your function down to (basically):
This allows us to do something like I did. |
|||