Seite 95 von 342 ErsteErste ... 45 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 145 195 ... LetzteLetzte
Zeige Ergebnis 2.821 bis 2.850 von 10238

Lua Programming Help Thread

This is a discussion on Lua Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; yeah... but if the AI is slower then the player then he would most likely never catch the player. So ...

  
  1. #2821
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    yeah... but if the AI is slower then the player then he would most likely never catch the player. So you need to incorporate a part in which the enemy predicts where the player is going so it can catch up. (btw, this is what I'm trying to learn to do, the prediction part).



  2. #2822
    QJ Gamer Green
    Points: 8.215, Level: 61
    Level completed: 22%, Points required for next Level: 235
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Illinois
    Beiträge
    897
    Points
    8.215
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    http://www.sendspace.com/file/4jg6xl
    Can someone PLEASE take a look at my code. There is a problem with putting the animation on the screen. I haven't been able to work on my game for several days now because I can't get the animation to work.

  3. #2823
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Maybe you want to give us the part that's giving you trouble. That way we don't have to look at the entire code.

  4. #2824
    QJ Gamer Green
    Points: 8.215, Level: 61
    Level completed: 22%, Points required for next Level: 235
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Illinois
    Beiträge
    897
    Points
    8.215
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Here is the code that is giving me trouble.
    Code:
    -- Set Default Image
    link = linkfaced
    
    -- Get Default Image Height And Width
    link:width()
    link:height()
    
    -- Get Screen Height And Width
    screenwidth = 480 - link:width()
    screenheight = 272 - link:width()
    
    -- Player Info
    player = {}
    player.x = 220
    player.y = 110
    player.moving = "no"
    player.facing = "down"
    player.pad = "none"
    
    -- Link Walking Down Animation Table
    linkwalkingd = {}
    linkwalkingd[1] = linkwalkingd1
    linkwalkingd[2] = linkwalkingd2
    linkwalkingd[3] = linkwalkingd3
    linkwalkingd[4] = linkwalkingd4
    linkwalkingd[5] = linkwalkingd5
    linkwalkingd[6] = linkwalkingd6
    linkwalkingd[7] = linkwalkingd7
    linkwalkingd[8] = linkwalkingd8
    
    -- Display Default Image
    screen:clear()
    screen:blit(player.x, player.y, link)
    screen.flip()
    screen:clear()
    
    -- Set loop count
    loopCount = 0
    loopCounts = 0
    
    -- Make Player Move Down
    if pad:down() and player.y < screenheight then
    player.y = player.y + 2
    
    player.moving = "yes"
    player.facing = "down"
    player.pad = "down"
    
    link = linkfaced
    
    end
    
    -- Link Walking Down Animation Loop
    if player.moving == "yes" and player.facing == "down" then
    if loopCount >= 0 and loopCount < 2 then link = linkwalkingd[1]
    elseif loopCount >= 2 and loopCount < 4 then link = linkwalkingd[2]
    elseif loopCount >= 4 and loopCount < 6 then link = linkwalkingd[3]
    elseif loopCount >= 6 and loopCount < 8 then link = linkwalkingd[4]
    elseif loopCount >= 8 and loopCount < 10 then link = linkwalkingd[5]
    elseif loopCount >= 10 and loopCount < 12 then link = linkwalkingd[6]
    elseif loopCount >= 12 and loopCount < 14 then link = linkwalkingd[7]
    elseif loopCount >= 14 and loopCount < 16 then link = linkwalkingd[8] end
    if loopCount + 1 >= 16 then loopCount = 0 else loopCount = loopCount + 1 end
    end
    Geändert von cwirsing (07-17-2006 um 04:27 PM Uhr)

  5. #2825
    QJ Gamer Blue
    Points: 5.344, Level: 46
    Level completed: 97%, Points required for next Level: 6
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    347
    Points
    5.344
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    i want it so that my character shoots a bullet and it hits him. I also need to now how to get a bullet that comes from my characters gun in his hand.

  6. #2826
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    ok, Bob, you asking us for us to just give you code and yout putting it together,. Try going to evilmana.com and read the tuts their. Then come back and tell me if you know how to do all this ;)

  7. #2827
    QJ Gamer Blue
    Points: 5.344, Level: 46
    Level completed: 97%, Points required for next Level: 6
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    347
    Points
    5.344
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    i typed up the intro screen and everything but all of the tutorials don't explain very well i have tried that i could only get some of the code i typed to wrok even though it looked right by comparing.

  8. #2828
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    probably because the tuts are for his game, do not copy, paste. You have to fit it to your own code. Post your code and let me see how much you have as of now.

  9. #2829
    QJ Gamer Blue
    Points: 5.344, Level: 46
    Level completed: 97%, Points required for next Level: 6
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    347
    Points
    5.344
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    well right now access denied is helping me so i will see how it goes first before i post my code.

  10. #2830
    Developer
    Points: 4.006, Level: 40
    Level completed: 28%, Points required for next Level: 144
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Beiträge
    57
    Points
    4.006
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    i need help making my basic menu and so if you can help here is what i have: i know im missing something oh and all iget is flickering when i run it as in the thing i want white is white yet when i push up or down it flickers and doesn't exavtly go to the one under or over the one that is selected so yeah please help
    Code:
    red = Color.new(255, 0, 0)
    white = Color.new(255, 255, 255)
    p1 = Image.load ("p1.png")
    block = Image.load("block.png")
    menu = 0
    while true do
    pad = Controls.read()
    if pad:down() then
    menu = menu + 1
    end
    if pad:up() then
    menu = menu - 1
    end
    if menu < 0 then
    menu = 2
    end
    if menu > 2 then
    menu = 0
    end 
    if menu == 0 then
    screen:print(200, 60, "Start", white)
    screen:print(200, 80, "Options", red)
    screen:print(200, 100, "Quit", red)
    screen:flip()
    end
    if menu == 1 then
    screen:print(200, 60, "Start", red)
    screen:print(200, 80, "Options", white)
    screen:print(200, 100, "Quit", red)
    screen:flip()
    end
    if menu == 2 then
    screen:print(200, 60, "Start", red)
    screen:print(200, 80, "Options", red)
    screen:print(200, 100, "Quit", white)
    screen:flip()
    end
    if pad:start() then 
    break
    end
    end

  11. #2831
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    First of all, you don't need to add screen.flip() after every menu option. Second, you need to add this to the end.
    Code:
    screen.waitVblankStart()
    screen.flip()
    Also add this line above your "while true do"
    Code:
    oldpad = Controls.read()
    and add this under the "screen.flip()"
    Code:
    oldpad = pad
    and every time you have a "if pad" statement, change it to this:

    Code:
    if pad:button() and oldpad:button() ~= pad:button then
    blah blah blah
    end
    This will make it so it doesn't cycle through the options so fast.

  12. #2832
    Developer
    Points: 4.006, Level: 40
    Level completed: 28%, Points required for next Level: 144
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Beiträge
    57
    Points
    4.006
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    allright ill try it out

    Double Post Merge

    thanks a lot man that worked

  13. #2833
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Also, try these changes. The things I changed are in red.
    Code:
    red = Color.new(255, 0, 0)
    
    white = Color.new(255, 255, 255)
    p1 = Image.load ("p1.png")
    block = Image.load("block.png")
    menu = 0
    while true do
    screen:clear()-- you can't forget to add this to every program
    pad = Controls.read()
    screen:print(200,60,"Start",red)
    screen:print(200,80,"Options",red)
    screen:print(200,100,"Quit",red)
    if pad:down() then
    menu = menu + 1
    end
    if pad:up() then
    menu = menu - 1
    end
    if menu < 0 then
    menu = 2
    end
    if menu > 2 then
    menu = 0
    end 
    if menu == 0 then
    screen:print(200, 60, "Start", white)
    end
    if menu == 1 then
    screen:print(200, 80, "Options", white)
    end
    if menu == 2 then
    screen:print(200, 100, "Quit", white)
    end
    if pad:start() then 
    break
    end
    end
    By making these changes you are just cleaning up your code by having less lines.

  14. #2834
    Developer
    Points: 4.006, Level: 40
    Level completed: 28%, Points required for next Level: 144
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Beiträge
    57
    Points
    4.006
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    hey thanks again oh and about the screen clear why do you need to put it cuase ive seen it used a lot like that and don't understand why you need it so if you could explain thatwouls be great and thanks again!

  15. #2835
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Because if you didn't have the screen:clear(), everything would be pasted on top of each other. Say you had a game, where a blue block moves around the screen. If you didn't have the screen:clear(), when the block moved thier would be a trail behind it. Take it out of your program and see what happens.
    BTW- Screen:clear() always clears the screen black, but if you want a blue background or something, you could use this:

    Code:
    screen:clear(blue)
    or you could use a picture for a background:

    Code:
    screen:clear(Picture you want)

  16. #2836
    Developer
    Points: 4.006, Level: 40
    Level completed: 28%, Points required for next Level: 144
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Beiträge
    57
    Points
    4.006
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    oh allright that makes sense thanks for the explanation and advice

  17. #2837
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    No problem. :)

  18. #2838
    Developer
    Points: 5.162, Level: 46
    Level completed: 6%, Points required for next Level: 188
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Tauranga, New Zealand
    Beiträge
    355
    Points
    5.162
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von cwirsing
    Here is the code that is giving me trouble.
    There doesn't appear to be anything wrong with the code you've shown (although I may be missing something). A problem is going on somewhere else, and that is with the "linkfaced" variable. But I have no idea what that variable is set to, so I can't help.

  19. #2839
    QJ Gamer Bronze
    Points: 5.924, Level: 49
    Level completed: 87%, Points required for next Level: 26
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Earth, UK
    Beiträge
    457
    Points
    5.924
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    where can i find lua tuturails on using the psps wifi?
    thanks in advance
    <<Put A message Here>>
    <<Just made another rubbish website visit it here.>>

  20. #2840
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    the only way to use wifi with LUA right now is with netlib. There's no tut for it, but there is a very easy example with it. Ah whatever I'll write a very short tut:

    what you need:
    - netlib2.0
    The file itself is called "netlib.lua". Put it in the same folder as your app (this isn't necessairy, you can also put it somewhere else, the path in the "dofile()" command will just change).

    First the stuff that should be before your main loop (also remember to turn on the wifi with "Wlan.init()" and connect to the internet using "Wlan.useConnectionConfig (connection)", where "connection" is the number of the connection you want to use. For example: with Wlan.useConnectionConfig( 1) you would connect to your first connection):

    1) In your app you have to import it by saying "dofile("netlib.lua") ".
    2) After that you have to connect to the server with this "netconnect()"
    3) Now before you can send and receive date, you have to create a variable on the server where you can send and receive your data to. You do this with the following command: netreg(id), where id is the name you want the variable to have.
    (This command also makes sure the server sends the valua of the variable, whenever the valua of it changes)

    Now comes the part that should be in the main loop itself
    4) Now you have created a variable on the server you can send data to it by using "netsend(id, data, attribute)", where "id" is the name of the variable, data is the data in a string format (this means you have to turn tables and numbers and other formats into a string first) and where "attribute" is the way you want the data to be put in the variable. The attribute can either be "w" or "a". "w" means write and you will replace data, "a" means append and you will add the new data to the data that was already in the variable.
    5) To receive data, you would say "netrecv()". This will receive all incoming data.
    6) You don't have the value of the variable yet though. For that you need to use "netvalue(id)", where "id" is again the name of the variable. You need to put this after the "netrecv()" command.

    After the main loop, you will need to delete the variable and close the connection:
    7) To delete the variable on the server: netunreg(id), where "id" is the name of the variable
    8) To close the connection to the server: netclose()
    9) To close wifi: Wlan.term()

    As an example I have put the example of yoursam (the author of this app) here:

    Code:
    --[[
    netlib example
    by youresam
    ]]
    
    dofile("netlib.lua") -- netlib
    
    Wlan.init()
    print("Connecting to "..Wlan.getConnectionConfigs()[1].."...")
    Wlan.useConnectionConfig(1)
    
    print("Connecting to netlib server...")
    netconnect() -- connect to netlib server
    
    print("Setting up AMW for 'netlibtest' (wont do anything in this example..)")
    netreg("netlibtest")
    
    print("Sending 'helloworld' to 'netlibtest'")
    netsend("netlibtest","helloworld","w") -- id:netlibtest data:helloworld mode:write
    
    print("Getting 'netlibtest'...(Press start to quit)")
    netget("netlibtest")
    while true do
    	netrecv() --recieve all incoming data
    	buffer = netvalue("netlibtest") --what is the value of the id 'netlibtest'?
    		if buffer ~= "" then --if it exists...
    			print(buffer)
    			break
    		end
    	if Controls.read():start() then break end
    end
    
    netunreg("netlibtest") --ALWAYS unregister a variable when your done
    
    netclose() --close the netlib connection
    
    Wlan.term()
    
    print("Program finished, hold start to exit.")
    As you can see he uses netget(id) instead of netrecv() and netvalue(id). Eventhough its possible, its way slower (so he said to me). He still uses it because he only needs to get the data once and not continues (I think?). If you want to get the data every loop its better to use netrecv() and netvalue(id).

    Hope it's clear enough (and right. If not please correct me anyone). I didn't explain the mail, sms and call functions. I just explained the basic sending and receiving.
    Geändert von Altair (07-21-2006 um 05:52 AM Uhr)
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

    LUA Wiki:
    [url]http://wiki.ps2dev.org/psp:lua_player[/url]

  21. #2841
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Altair
    the only way to use wifi with LUA right now is with netlib. There's no tut for it, but there is a very easy example with it. Ah whatever I'll write a very short tut:

    what you need:
    - netlib2.0
    The file itself is called "netlib.lua". Put it in the same folder as your app (this isn't necessairy, you can also put it somewhere else, the path in the "dofile()" command will just change).

    First the stuff that should be before your main loop (also remember to turn on the wifi with "Wlan.init()" and connect to the internet using "Wlan.useConnectionConfig (connection)", where "connection" is the number of the connection you want to use. For example: with Wlan.useConnectionConfig( 1) you would connect to your first connection):

    1) In your app you have to import it by saying "dofile("netlib.lua") ".
    2) After that you have to connect to the server with this "netconnect()"
    3) Now before you can send and receive date, you have to create a variable on the server where you can send and receive your data to. You do this with the following command: netreg(id), where id is the name you want the variable to have.
    (This command also makes sure the server sends the valua of the variable, whenever the valua of it changes)

    Now comes the part that should be in the main loop itself
    4) Now you have created a variable on the server you can send data to it by using "netsend(id, data, attribute)", where "id" is the name of the variable, data is the data in a string format (this means you have to turn tables and numbers and other formats into a string first) and where "attribute" is the way you want the data to be put in the variable. The attribute can either be "w" or "a". "w" means write and you will replace data, "a" means append and you will add the new data to the data that was already in the variable.
    5) To receive data, you would say "netrecv()". This will receive all incoming data.
    6) You don't have the value of the variable yet though. For that you need to use "netvalue(id)", where "id" is again the name of the variable. You need to put this after the "netrecv()" command.

    After the main loop, you will need to delete the variable and close the connection:
    7) To delete the variable on the server: netunreg(id), where "id" is the name of the variable
    8) To close the connection to the server: netclose()
    9) To close wifi: Wlan.term()

    As an example I have put the example of yoursam (the author of this app) here:

    Code:
    --[[
    netlib example
    by youresam
    ]]
    
    dofile("netlib.lua") -- netlib
    
    Wlan.init()
    print("Connecting to "..Wlan.getConnectionConfigs()[1].."...")
    Wlan.useConnectionConfig(1)
    
    print("Connecting to netlib server...")
    netconnect() -- connect to netlib server
    
    print("Setting up AMW for 'netlibtest' (wont do anything in this example..)")
    netreg("netlibtest")
    
    print("Sending 'helloworld' to 'netlibtest'")
    netsend("netlibtest","helloworld","w") -- id:netlibtest data:helloworld mode:write
    
    print("Getting 'netlibtest'...(Press start to quit)")
    netget("netlibtest")
    while true do
    	netrecv() --recieve all incoming data
    	buffer = netvalue("netlibtest") --what is the value of the id 'netlibtest'?
    		if buffer ~= "" then --if it exists...
    			print(buffer)
    			break
    		end
    	if Controls.read():start() then break end
    end
    
    netunreg("netlibtest") --ALWAYS unregister a variable when your done
    
    netclose() --close the netlib connection
    
    Wlan.term()
    
    print("Program finished, hold start to exit.")
    As you can see he uses netget(id) instead of netrecv() and netvalue(id). Eventhough its possible, its way slower (so he said to me). He still uses it because he only needs to get the data once and not continues (I think?). If you want to get the data every loop its better to use netrecv() and netvalue(id).

    Hope it's clear enough (and right. If not please correct me anyone). I didn't explain the mail, sms and call functions. I just explained the basic sending and receiving.
    Damn, thats really good! You should create a seperate thread with this tut in it, so it isnt lost withini all these pages.

  22. #2842
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    I agree. BTW- shouldn't have this thread been stickied by now?

  23. #2843
    QJ Gamer Bronze
    Points: 5.924, Level: 49
    Level completed: 87%, Points required for next Level: 26
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Earth, UK
    Beiträge
    457
    Points
    5.924
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Hi
    Can anyone tell me if and how you can use the psp ad hoc mode on lua?
    Ps. Thanks Altair for answering my previous question
    <<Put A message Here>>
    <<Just made another rubbish website visit it here.>>

  24. #2844
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Access_Denied
    I agree. BTW- shouldn't have this thread been stickied by now?
    It was, but now its linked to in a stickied.

  25. #2845
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    That's pretty stupid.

    Yes, JoeDaStudd, you can use ad-hoc in LUA. I don't know how though.

  26. #2846
    QJ Gamer Green
    Points: 5.559, Level: 48
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Beiträge
    506
    Points
    5.559
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Thx, if you all think so, i guess I will make a seperate thread about it.

    @Acces denied: since when is ad-hoc supported with LUA? Do you maybe have a link or something? That would be really great if it's possible. I do know somebody said it would be really easy, but he said he didn't have the time to do it, so im not to sure on his credibility.
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

    LUA Wiki:
    [url]http://wiki.ps2dev.org/psp:lua_player[/url]

  27. #2847
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    yeah you sould create a thread for it.

  28. #2848
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Altair
    Thx, if you all think so, i guess I will make a seperate thread about it.

    @Acces denied: since when is ad-hoc supported with LUA? Do you maybe have a link or something? That would be really great if it's possible. I do know somebody said it would be really easy, but he said he didn't have the time to do it, so im not to sure on his credibility.
    Maybe it isn't supported in LUA. I always thought it was. Guess I better check my info.
    Did a google search and found out it isn't.

  29. #2849
    QJ Gamer Blue
    Points: 4.631, Level: 43
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    81
    Points
    4.631
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    can someone tell me how can i rotate and zoom an image in realtime in lua?what are the functions i have to use?cuz im kinda new to lua and trying to port a game i made in flash.tnx :)

  30. #2850
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von fuxer
    can someone tell me how can i rotate and zoom an image in realtime in lua?what are the functions i have to use?cuz im kinda new to lua and trying to port a game i made in flash.tnx :)
    this is from the lua snippets thread:

    this will rotate an image by a cretain agle:

    Code:
    function rotateImage(theImage, angle)
    screen:blit(0,0,theImage)  
    angle = angle*(6 + (1/3))/360
    	for x = 1, theImage:width() do
    		for y = 1, theImage:height() do
    			tX = math.cos(angle)*(x-theImage:width()) - math.sin(angle) * (y-theImage:height())
    			tY = math.sin(angle)*(x-theImage:width()) + math.cos(angle) * (y-theImage:height())
    			screen:fillRect(tX + 240, tY + 136, 2, 2, screen:pixel(x, y))
    		end
    	end
    end
    --------------------------------------------------------------------------------------


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 09:02 PM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .