|
#1
|
||||
|
||||
|
hi im starting to try to have a go making leamonade tycoon but havent programed very much lua apps. i was wondering how you would make the little people in the game move????????
![]() plus does any other more experenced programmers want to help????????![]() ![]()
|
| Advertisement | [Remove Advertisement] |
|
|
|
|
#2
|
||||
|
||||
|
well, making lemondae tycoon would be a very hard challenge.
But i will help you all i can so, you say you wanted the people to move around. Here's a simple script for 1 person. width=screen.width() height=screen.height() --set the screensize imageofperson=image.load("icon.png") --load the image of person white=color.new(255,255,255)--this is the colour white randomn=0 --this is the variable that decides wehter he moves left, right.... person1X=200 --the persons X coridantes person1Y=120 --the persond Y coridantes function drawgame() screen.fillrect(0,0,width,height,white); --draw the background imageofperson:draw(person1X,person1Y) -- draw the person screen.update() end while true do -- forever randomn=math.random(1,4) --set random to 1,2,3or4 if randomn==1 then --move right person1X=person1X+10 end if randomn==2 then -- move left person1X=person1X-10 end if randomn==3 then --move up person1Y=person1Y-10 end if randomn==4 then --move DOWN person1Y=person1Y+10 end drawgame() --excutes the function drawgame() os.sleep(50) --wait a bit end Last edited by lsquish; 04-16-2010 at 12:06 PM. |
|
#3
|
||||
|
||||
|
thanks this what ive got so far
menu=image.load("images/menu.jpg") function menu() bg:draw(0,0) screen.update() os.sleep(200) end height = screen.height() width= screen.width() local black = color.new(0,0,0) local colorWhite = color.new(255, 255, 255); --load image print("load images") |
|
#4
|
||||
|
||||
|
Quote:
whats the "print("load images")" if you want to draw a image you must have: name of the image:draw(X position,Yposition) Can you explaing exactly what you are trying to do |
|
#5
|
||||
|
||||
|
tryin to load the menu background
|
|
#6
|
||||
|
||||
|
this the menu
|
|
#7
|
||||
|
||||
|
Code:
menu:draw(0,0,width,height) Code:
menu=image.load("images/menu.jpg")
(Also, the image cannot exceed 400x240 pixel)
__________________
"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. ^.^ |
|
#8
|
|||
|
|||
|
I think it's better to use PNG images instead of JPEG. As with PNG every pixels has it's own color, while with JPEG you get blurry blech bla..... horrible text, as you can see in the menu image. Use the original source to save this image as .png
As Habhome says. The screen of the X-Fi2 is 400x240 pixels, using a background image with dimensions 480x320 isn't optimal. But I guess the Zen can work with it, it either runs out of screen space giving you a incomplete menu or the image has to be scaled down which is pointless. But the start looks nice. I can't wait to play this game.
__________________
Snake for the X-Fi2 |
|
#9
|
||||
|
||||
|
I think we established a while ago that if the image exceeds 400x240 the application crashes. If I remember correctly that is.
I'd also suggest .PNG, for the reasons stated by Zaffo. And on a note of animations. You don't need to make the game exactly like the original where you can see the people move about. I've played another version of this which is completely text/image based, and it's really fun.
__________________
"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. ^.^ |
|
#10
|
||||
|
||||
|
do u have a link to it plz
|
|
#11
|
||||
|
||||
|
http://www.funplanet.se/ go to "spel" then "safteriet". It's a version of it, very simple. And all in Swedish.
__________________
"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
|
||||
|
||||
|
thanks its alot simpler
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 02:35 AM.













Linear Mode
