![]() |
Mario Development Thread
2 Attachment(s)
LAST UPDATED 30 June 2011
This is super mario bros for the Zen x-fi 2. This is what I have done so far: Intro Screen Mario Moving Right Mario Moving Left Menu (new!) ( see second thumbnail) This is what I have to do: Mario Jumping Enemies Maps Bricks Can anyone think of a name for the game? Thanks |
Quote:
|
Super Xfi2 Brothers! XD
|
Quote:
|
Coding problems, Mario not moving.
Hi, this code is meant to load the background and mario images, and when the RIGHT half of this screen is pressed, mario should move, same for LEFT.
But the movement doesn't happen. What am i doing wrong? Is there anything I am coding wrong? Thanks. Code:
background = image.load("background.jpg") |
I went through the could and fixed it all up
http://snipt.org/xkloj Here is what was wrong: first off , when you put this : x,y = touch.pos(); you used lower case x and y but you use capital X and Y in your ifs (Lua is case sensitive), also you should keep a screen.update() at the end of a loop, you had it only update when the user touched the left half, also NEVER name a variable string (string is a module ie: string.find() and by naming something string you override the module). One other thing, dont load up the screen.updates while loading variable, and also please indent, by doing so it is alot easier to catch the majority of bugs ( i found this out the hard way :) ) One last tip, when naming resources like an image try and use a name like this: "marioimg" |
THANKS! that helped.
|
[Threads Merged]
Please ask questions regarding your game in the dev-thread dedicated to it, that's what it's there for to begin with.. |
Jumping and Scrolling
Quote:
How can I make Mario jump, I have a playerX and PlayerY variable, how can I change this to make him jump? And, how can I make the game scene scroll when the player is near the right edge? Thanks... |
Where can i download mario for zen x-fi2?
|
It is not finished Nediam... Development just started some days ago from what I know, can't expect to get a finished game that fast.
|
Good luck with the game development, james. I hope you'll have the patience to learn. :)
I've done ZEN Tower as my very first app in lua and it worked well, so you definitely have a chance. As for the jumping: You'll need to simulate earth's gravity. That means you have a certain jump velocity (vertical) - number of pixels the character moves by per each cycle. In opposite direction there is the G-force acceleration, so the final vertical velocity will be v-gt where v stands for char's initial velocity in vertical direction, g is constant (9.81) and t counts (milli)seconds from the start of the jump. That means you add v-gt to playerY in each cycle. (Provided you assign negative number to v - the "minus" sign designating up direction whereas gt will be positive because it "pushes" the char down.) When gt gets higher than v, the character will start to fall so the last thing you'll have to do is to set the boundaries so that it doesn't fall through the ground. :D This is the way I used in ZEN Tower, you can check my source code, function updatePlayerPos() to be specific. |
thanks, what about the scrolling screen? The game needs to be larger than 400X240 pixels!
|
Quote:
|
Yes, regarding the actual scrolling process, I'd see it like this:
You can have character's absolute position defined and then also the world offset (the visible part). Then you can easily change these values and have the final screen position determined by the subtraction of each two values (relX=absX-offX and the same for Y possibly). Finally, you just add an if statement of some kind to check relX and toggle screen scrolling. |
use the name i came up with :P lol
|
Quote:
|
| All times are GMT -5. The time now is 05:16 PM. |