|
#1
|
|||
|
|||
|
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 Last edited by jameswalker101; 06-30-2011 at 01:33 PM. |
|
|
|||
|
|
|
#2
|
||||
|
||||
|
__________________
Snake [Ru/Eng] | Who Wants to Be a Millionaire? [Ru/Eng] | Pacman [Ru] | BrainStorm [Ru/Eng] |
|
#3
|
||||
|
||||
|
Super Xfi2 Brothers! XD
__________________
I wUz he3R
|
|
#4
|
|||
|
|||
|
__________________
Apps: Guitar Tuner- http://anythingbutipod.com/forum/showthread.php?t=61049 |
|
#5
|
|||
|
|||
|
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 |
|
#6
|
||||
|
||||
|
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"
__________________
Tools: Playlist Manager , Document to RSS , Notepad++ Instellisense Games/Apps: Asteroids, ZenFrame, Graphing Calculator, Pingus X-Fi2, Boxwars, SkiFree, Jezzball |
|
#7
|
|||
|
|||
|
THANKS! that helped.
__________________
Apps: Guitar Tuner- http://anythingbutipod.com/forum/showthread.php?t=61049 |
|
#8
|
||||
|
||||
|
[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. ^.^ |
|
#9
|
|||
|
|||
|
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...
__________________
Apps: Guitar Tuner- http://anythingbutipod.com/forum/showthread.php?t=61049 |
|
#10
|
|||
|
|||
|
Where can i download mario for zen x-fi2?
|
|
#11
|
||||
|
||||
|
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. ^.^ |
|
#12
|
||||
|
||||
|
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. |
|
#13
|
|||
|
|||
|
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 |
|
#14
|
||||
|
||||
|
Quote:
__________________
Tools: Playlist Manager , Document to RSS , Notepad++ Instellisense Games/Apps: Asteroids, ZenFrame, Graphing Calculator, Pingus X-Fi2, Boxwars, SkiFree, Jezzball |
|
#15
|
||||
|
||||
|
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. |
|
#16
|
||||
|
||||
|
use the name i came up with :P lol
__________________
I wUz he3R
|
|
#17
|
|||
|
|||
|
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 |
![]() |
| Tags |
| mario |
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 12:00 PM.












I wUz he3R
)
Linear Mode
