android
  #1  
Old 06-21-2011, 02:05 PM
jameswalker101 jameswalker101 is offline
Junior Member
 
Join Date: Jul 2010
Location: United Kingdom
Posts: 91
Cool Mario Development Thread

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
Attached Images
File Type: jpg mario.jpg (76.6 KB, 134 views)
File Type: png play.png (4.6 KB, 197 views)

Last edited by jameswalker101; 06-30-2011 at 01:33 PM.
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 06-22-2011, 02:37 AM
alexvilla's Avatar
alexvilla alexvilla is offline
Junior Member
 
Join Date: Sep 2010
Location: Russia, Saint Petersburg
Posts: 64
Default

Quote:
Originally Posted by jameswalker101 View Post
Can anyone think of a name for the game? Thanks
Mario
Reply With Quote

  #3  
Old 06-22-2011, 09:01 AM
datallboy's Avatar
datallboy datallboy is offline
Member
 
Join Date: Feb 2010
Posts: 143
Default

Super Xfi2 Brothers! XD
__________________
I wUz he3R
Reply With Quote

  #4  
Old 06-22-2011, 12:03 PM
jameswalker101 jameswalker101 is offline
Junior Member
 
Join Date: Jul 2010
Location: United Kingdom
Posts: 91
Default

Quote:
Originally Posted by datallboy View Post
Super Xfi2 Brothers! XD
Nice...
__________________
Apps: Guitar Tuner- http://anythingbutipod.com/forum/showthread.php?t=61049
Reply With Quote

  #5  
Old 06-23-2011, 01:49 PM
jameswalker101 jameswalker101 is offline
Junior Member
 
Join Date: Jul 2010
Location: United Kingdom
Posts: 91
Cool 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")
background:draw(0,0)
screen.update()
Mario = image.load("Mario.png")
screen.update()
os.sleep(100)

playerX=106
playerY=158
Mario:draw(playerX,playerY)
screen.update()
X=373
Y=0

Mario:draw(playerX,playerY)

while true do
x,y = touch.pos();

if
X>=201 then
string = 1
print(string)
playerX=playerX+3
background:draw(0,0)
Mario:draw(playerX,playerY)
elseif
X<=200 then
string = 1
print(string)
playerX=playerX-3
background:draw(0,0)
Mario:draw(playerX,playerY)

screen.update()
end
end
__________________
Apps: Guitar Tuner- http://anythingbutipod.com/forum/showthread.php?t=61049
Reply With Quote

  #6  
Old 06-23-2011, 02:07 PM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

I went through the code 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"

Last edited by jbob182; 11-03-2013 at 12:22 PM.
Reply With Quote

  #7  
Old 06-23-2011, 02:19 PM
jameswalker101 jameswalker101 is offline
Junior Member
 
Join Date: Jul 2010
Location: United Kingdom
Posts: 91
Default

THANKS! that helped.
__________________
Apps: Guitar Tuner- http://anythingbutipod.com/forum/showthread.php?t=61049
Reply With Quote

  #8  
Old 06-24-2011, 10:43 AM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

[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..
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #9  
Old 06-24-2011, 11:46 AM
jameswalker101 jameswalker101 is offline
Junior Member
 
Join Date: Jul 2010
Location: United Kingdom
Posts: 91
Cool Jumping and Scrolling

Quote:
Originally Posted by Habhome View Post
[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..
Ok, I am new to lua so i may need a lot of help...

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...
__________________
Apps: Guitar Tuner- http://anythingbutipod.com/forum/showthread.php?t=61049
Reply With Quote

  #10  
Old 06-24-2011, 12:29 PM
Nediam Nori Nediam Nori is offline
Junior Member
 
Join Date: Jun 2011
Posts: 12
Default

Where can i download mario for zen x-fi2?
Reply With Quote

  #11  
Old 06-25-2011, 05:54 AM
Habhome's Avatar
Habhome Habhome is offline
Moderator
 
Join Date: Jan 2010
Location: Sweden
Posts: 1,079
Default

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.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine
Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it!
Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it.
Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^
Reply With Quote

  #12  
Old 06-25-2011, 06:38 AM
Nohajc's Avatar
Nohajc Nohajc is offline
Junior Member
 
Join Date: Mar 2010
Location: Czech Republic
Posts: 68
Default

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.

This is the way I used in ZEN Tower, you can check my source code, function updatePlayerPos() to be specific.
__________________
There was a little man...

Last edited by Nohajc; 07-01-2011 at 12:55 PM.
Reply With Quote

  #13  
Old 06-30-2011, 01:28 PM
jameswalker101 jameswalker101 is offline
Junior Member
 
Join Date: Jul 2010
Location: United Kingdom
Posts: 91
Default

thanks, what about the scrolling screen? The game needs to be larger than 400X240 pixels!
__________________
Apps: Guitar Tuner- http://anythingbutipod.com/forum/showthread.php?t=61049
Reply With Quote

  #14  
Old 06-30-2011, 01:40 PM
jbob182's Avatar
jbob182 jbob182 is offline
X-Fi2 Development Moderator
 
Join Date: Feb 2010
Location: The U.S.A.
Posts: 554
Default

Quote:
thanks, what about the scrolling screen? The game needs to be larger than 400X240 pixels!
We have dealt with this in Pingus, you need to crop the map into several jpgs's (size cant be more than 400x600) and then tile them.
Reply With Quote

  #15  
Old 07-01-2011, 12:40 PM
Nohajc's Avatar
Nohajc Nohajc is offline
Junior Member
 
Join Date: Mar 2010
Location: Czech Republic
Posts: 68
Default

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.
__________________
There was a little man...

Last edited by Nohajc; 07-01-2011 at 12:54 PM.
Reply With Quote

  #16  
Old 07-01-2011, 02:05 PM
datallboy's Avatar
datallboy datallboy is offline
Member
 
Join Date: Feb 2010
Posts: 143
Default

use the name i came up with :P lol
__________________
I wUz he3R
Reply With Quote

  #17  
Old 07-29-2011, 03:06 PM
jameswalker101 jameswalker101 is offline
Junior Member
 
Join Date: Jul 2010
Location: United Kingdom
Posts: 91
Default

Quote:
Originally Posted by datallboy View Post
use the name i came up with :P lol
Yes, I think that will be the name. More info soon on the game, I am working on coins and enemies. This game will be like the origianal Super Mario Bros, but with super mario bros 3 style graphics.
__________________
Apps: Guitar Tuner- http://anythingbutipod.com/forum/showthread.php?t=61049
Reply With Quote

Reply

Tags
mario

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 10:37 AM.