Seite 84 von 342 ErsteErste ... 34 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 134 184 ... LetzteLetzte
Zeige Ergebnis 2.491 bis 2.520 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; yes you could do sometin like this: me = 5 you = 6 them = 7 nine = 9 screen:drawline(me,you,th ...

  
  1. #2491
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    yes you could do sometin like this:

    me = 5
    you = 6
    them = 7
    nine = 9
    screen:drawline(me,you,th em,nine,red)

    they just use x0,y0,x1,y1 as examples you could call variables whatever you want it don't matter


    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  2. #2492
    QJ Gamer Gold
    Points: 18.627, Level: 86
    Level completed: 56%, Points required for next Level: 223
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    LOLWUT
    Beiträge
    2.625
    Points
    18.627
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Thanks everybody!

  3. #2493
    QJ Gamer Green
    Points: 13.310, Level: 75
    Level completed: 15%, Points required for next Level: 340
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Here
    Beiträge
    2.715
    Points
    13.310
    Level
    75
    Downloads
    0
    Uploads
    0

    Standard

    drawing a curved line?
    how about those old "y = x^2" (i think its like that...) formulas?

    anyone whos used a graphing calculator should know what i mean. you can make the "y" be the position of the pixels, right?

    and then make a "for" loop so that the pixels make a (curved) line.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  4. #2494
    QJ Gamer Gold
    Points: 18.627, Level: 86
    Level completed: 56%, Points required for next Level: 223
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    LOLWUT
    Beiträge
    2.625
    Points
    18.627
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    I'll try that. But I'm having trouble with this code:
    Code:
    black = Color.new(0, 0, 0)
    white = Color.new(255, 255, 255)
    grey = Color.new(127,127,127)
    red = Color.new(255, 0, 0) 
    green = Color.new(0, 255, 0)
    blue = Color.new(0, 0, 255)
    yellow = Color.new(255,255,0)
    purple = Color.new(120,0,120)
    pink = Color.new(255,0,255)
    orange = Color.new(255,110,0)
    
    width = 50
    height = 100
    x = 10
    y = 136
    x1 = 470
    y1 = 136
    
    screencolor = white
    paddlecolor = black
    
    while true do
    screen:clear(white)
    pad = Controls.read()
    
    if pad:up() then
    y = y + 2
    screen.waitVblankStart(4)
    end
    
    if pad:down() then
    y = y - 2
    screen.waitVblankStart(4)
    end
    
    if pad:cross() then
    y1 = y1 - 2
    screen.waitVblankStart(4)
    end
    
    if pad:triangle() then
    y1 = y1 + 2
    screen.waitVblankStart(4)
    end
    
    if y1 <= -1 then
    y1 = 0
    end
    
    if y <= -1 then
    y = 0
    end
    
    if y <= 273 then
    y = 272
    end
    
    if y1 <= 273 then
    y1 = 272
    end
    
    screen:fillRect(x,y,width,height,black)
    screen:fillRect(x1,y1,width,height,black)
    
    screen.waitVblankStart()
    screen.flip()
    end
    Yes I'm trying to make a pong game, but the rectangles wont show up.

  5. #2495
    QJ Gamer Green
    Points: 13.310, Level: 75
    Level completed: 15%, Points required for next Level: 340
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Here
    Beiträge
    2.715
    Points
    13.310
    Level
    75
    Downloads
    0
    Uploads
    0

    Standard

    try switching back the colors. (blocks are white, background is black.)
    and leave the "screen:clear()" alone, so it doesnt mention a color.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  6. #2496
    QJ Gamer Gold
    Points: 18.627, Level: 86
    Level completed: 56%, Points required for next Level: 223
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    LOLWUT
    Beiträge
    2.625
    Points
    18.627
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von EminentJonFrost
    try switching back the colors. (blocks are white, background is black.)
    and leave the "screen:clear()" alone, so it doesnt mention a color.
    Meh, I took white out of screen:clear(), and changed the color of the paddles to white, and it didn't show up still. I guess I'll use pre-set images, or Image.createEmpty.

  7. #2497
    QJ Gamer Green
    Points: 13.310, Level: 75
    Level completed: 15%, Points required for next Level: 340
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Here
    Beiträge
    2.715
    Points
    13.310
    Level
    75
    Downloads
    0
    Uploads
    0

    Standard

    wait, isnt it supposed to be "drawRect" instead of "fillRect"?
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  8. #2498
    QJ Gamer Gold
    Points: 18.627, Level: 86
    Level completed: 56%, Points required for next Level: 223
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    LOLWUT
    Beiträge
    2.625
    Points
    18.627
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von EminentJonFrost
    wait, isnt it supposed to be "drawRect" instead of "fillRect"?
    Whne I tried that it gave me that drawRect was a nil value.

  9. #2499
    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 PSPduh
    I'll try that. But I'm having trouble with this code:
    Code:
    black = Color.new(0, 0, 0)
    white = Color.new(255, 255, 255)
    grey = Color.new(127,127,127)
    red = Color.new(255, 0, 0) 
    green = Color.new(0, 255, 0)
    blue = Color.new(0, 0, 255)
    yellow = Color.new(255,255,0)
    purple = Color.new(120,0,120)
    pink = Color.new(255,0,255)
    orange = Color.new(255,110,0)
    
    width = 50
    height = 100
    x = 10
    y = 136
    x1 = 470
    y1 = 136
    
    screencolor = white
    paddlecolor = black
    
    while true do
    screen:clear(white)
    pad = Controls.read()
    
    if pad:up() then
    y = y + 2
    screen.waitVblankStart(4)
    end
    
    if pad:down() then
    y = y - 2
    screen.waitVblankStart(4)
    end
    
    if pad:cross() then
    y1 = y1 - 2
    screen.waitVblankStart(4)
    end
    
    if pad:triangle() then
    y1 = y1 + 2
    screen.waitVblankStart(4)
    end
    
    if y1 <= -1 then
    y1 = 0
    end
    
    if y <= -1 then
    y = 0
    end
    
    if y <= 273 then
    y = 272
    end
    
    if y1 <= 273 then
    y1 = 272
    end
    
    screen:fillRect(x,y,width,height,black)
    screen:fillRect(x1,y1,width,height,black)
    
    screen.waitVblankStart()
    screen.flip()
    end
    Yes I'm trying to make a pong game, but the rectangles wont show up.
    three things:

    1. why do you have screen.waitVblankStart(4) after everytime you move??

    2. the screen:fillRect is muuch too complicated for what you need. a simple Image.createEmpty command will work just as fine.

    3. thats one big list of colors you got. ;)
    --------------------------------------------------------------------------------------

  10. #2500
    QJ Gamer Green
    Points: 13.310, Level: 75
    Level completed: 15%, Points required for next Level: 340
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Here
    Beiträge
    2.715
    Points
    13.310
    Level
    75
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    three things:

    1. why do you have screen.waitVblankStart(4) after everytime you move??

    2. the screen:fillRect is muuch too complicated for what you need. a simple Image.createEmpty command will work just as fine.

    3. thats one big list of colors you got. ;)
    the screen.waitVblankStarts are so the effects of pressing a button dont accidently repeat more than what you want.

    i agree with the amount of colors. thats alot. why do you have so many? if its so you dont have to remember them, then put this in your Favorites.

    http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  11. #2501
    QJ Gamer Gold
    Points: 18.627, Level: 86
    Level completed: 56%, Points required for next Level: 223
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    LOLWUT
    Beiträge
    2.625
    Points
    18.627
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    I dont know why I have so many colors. I just like to have a lot to choose from.

  12. #2502
    QJ Gamer Bronze
    Points: 5.744, Level: 48
    Level completed: 97%, Points required for next Level: 6
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Ort
    Plainfield, IL USA
    Beiträge
    18
    Points
    5.744
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard Hey

    I have a question. I'm using a sprite sheet for a game I'm making. I wanted to ask if anybody can tell me how you set a certain point on the sprite sheet into a variable? For example, as seen on EvilMana:

    Code:
    screen:blit(x, y, Image source, [sourcex, sourcey, width, height], [alpha = true])
    Well, I wanted to know if you can put the sourcex, sourcey, width, and height into a variable when you load an image instead of using the blit command. I think it will be much easier that way to do animation and such without loading a lot of image files.

    Any help will be appreciated. Thanks.

    ShockD

  13. #2503
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    Shock D, if i understand you correctly, then this might answer your question.

    You could put:
    image = Image.load("image.png")
    height = image:height()
    width = image:width()

    as for sourcex and sourcey, i'm not really even sure what they are/do.

  14. #2504
    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

    wats wrong with this code?

    Code:
    while true do
    screen:clear()
    screen:blit(0, 0, menu)
    screen.flip()
    screen.waitVblankStart(120)
    end
    
    pad = Controls.read()
    if pad:CROSS() then
    screen:clear()
    end
    i=1
    while i<=17 do
        screen:clear()
        counter:start()
        screen:blit(0, 0, background)
        screen:print(5, 100, questions[i], black)
        screen:print(5, 200, answerOne[i], white)
        screen:print(5, 215, answerTwo[i], white)
        screen:print(5, 230, answerThree[i], white)
        screen:print(5, 245, answerFour[i], white)
        inputreceived=0
         screen.flip()
        screen.waitVblankStart()
        while inputreceived==0 do
            pad = Controls.read()
    
            if pad:up() then
               screen.flip()
               if correctanswer[i]==1 then
                   screen:print(5, 110, "You're Correct!", green)
               else
                   screen:print(5, 110, "Sorry, incorrect.", red)
                   i=0
               end
               inputreceived=1
            end
    
            if pad:right() then
               screen.flip()
               if correctanswer[i]==2 then
                   screen:print(5, 110, "You're Correct!", green)
               else
                   screen:print(5, 110, "Sorry, incorrect.", red)
                   i=0
               end
               inputreceived=1
            end
            
            if pad:left() then
               screen.flip()
               if correctanswer[i]==3 then
                   screen:print(5, 110, "You're Correct!", green)
               else
                   screen:print(5, 110, "Sorry, incorrect.", red)
                   i=0
               end
               inputreceived=1
            end
            
            if pad:down() then
               screen.flip()
               if correctanswer[i]==4 then
                   screen:print(5, 110, "You're Correct!", green)
               else
                   screen:print(5, 110, "Sorry, incorrect.", red)
                   i=0
               end
               inputreceived=1
            end
        end
        i = i+1
        screen.flip()
    screen.waitVblankStart(120)
    end
    while true do
    screen:clear()
     counter:stop()
        currentTime = counter:time()
        screen:print(10,10,"Your time is " .. currentTime,red)
        screen.flip()
    screen.waitVblankStart(240)
    end

  15. #2505
    QJ Gamer Blue
    Points: 5.174, Level: 46
    Level completed: 12%, Points required for next Level: 176
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    125
    Points
    5.174
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard io.open

    im working right now on a load/save feature for my game, loading is easy but when it come to saving:

    file = io.open("loadsave/posx.txt","w")
    file:write("posx = ".. posx )
    file:write()
    file:close()

    this will save "posx = 0" (example) on a file, yeah, but how could i save more then 1 value, mutli-lines.

  16. #2506
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    bronxbomber92, i believe your code should read :
    if pad:cross() the cross shouldn't be in caps.

  17. #2507
    TheMarioKarters
    Guest

    Standard

    bronx, the cross shouldn't be caps!

    EDIT: I was beat..

  18. #2508
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    Yes, i actually beat someone :)

  19. #2509
    QJ Gamer Bronze
    Points: 5.744, Level: 48
    Level completed: 97%, Points required for next Level: 6
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Ort
    Plainfield, IL USA
    Beiträge
    18
    Points
    5.744
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von emericaska8r
    Shock D, if i understand you correctly, then this might answer your question.

    You could put:
    image = Image.load("image.png")
    height = image:height()
    width = image:width()

    as for sourcex and sourcey, i'm not really even sure what they are/do.
    Thanks for the reply emericaska8r.

    The sourcex and sourcey tells the program where to get the width and height from the image. For example, if you have 4 sprites on the sheet, for sourcex you would have to specify how many pixels to the right the 4th sprite is and same with sourcey. Eh... I hope you understood that. If not then oh well.

    Well anyway, that is a good idea. I'm going to play with that for awhile.

    Much thanks,
    ShockD

    Edit: Damn... this stuff is frustrating. When I load my game into the PSP, the background image becomes all distorted (the image is a jpg). It works fine with the windows LUA player. When I convert it into a .png it says error loading image. I set the correct path and extention all right.

    Also, it's a bit laggy but I think I know why. If anyone has some pointers on getting rid of lag, that would be great.

    Thanks again,
    ShockD
    Geändert von ShockD (05-27-2006 um 09:34 PM Uhr)

  20. #2510
    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 emericaska8r
    bronxbomber92, i believe your code should read :
    if pad:cross() the cross shouldn't be in caps.
    i tried that in windows lua player both ways, but the main menu screen would appear but when i press "c" (which is cross on windows) nothing happens, so it doesnt go on to the rest of the code. any help with that? thanks

  21. #2511
    QJ Gamer Bronze
    Points: 5.744, Level: 48
    Level completed: 97%, Points required for next Level: 6
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Ort
    Plainfield, IL USA
    Beiträge
    18
    Points
    5.744
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    @bronxbomber92

    In your screen.waitVblankStart, why is there a 12, two spaces, then a zero? I'm just curious as to what that zero does. And also, shouldn't all of that code (the one outside the main loop with the Controls.read()) be in a function?

    ShockD

  22. #2512
    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 spaces are because of the formatting of the text of this forum. It should read screen.waitVblankStart(12 0). The 120 means it waits 120 cycles of the screen refreshing. So that means it waits 2 seconds, since the refreshing rate is 60 Hz.
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  23. #2513
    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 ShockD
    @bronxbomber92

    In your screen.waitVblankStart, why is there a 12, two spaces, then a zero? I'm just curious as to what that zero does. And also, shouldn't all of that code (the one outside the main loop with the Controls.read()) be in a function?

    ShockD
    theere isnt really two spaces, the forum did that...and i dont think the Controls.read() should be in a function. if u look lower in the code i have a controls.read() and that works their. so no, i don't think so

  24. #2514
    QJ Gamer Green
    Points: 13.310, Level: 75
    Level completed: 15%, Points required for next Level: 340
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Here
    Beiträge
    2.715
    Points
    13.310
    Level
    75
    Downloads
    0
    Uploads
    0

    Standard

    like this, agashka:
    Code:
    file = io.open("loadsave/posx.txt","w")
    file:write("posx = ".. posx\n"posx2 = " ..posx2)
    file:close()
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  25. #2515
    QJ Gamer Bronze
    Points: 5.744, Level: 48
    Level completed: 97%, Points required for next Level: 6
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Ort
    Plainfield, IL USA
    Beiträge
    18
    Points
    5.744
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Altair
    the spaces are because of the formatting of the text of this forum. It should read screen.waitVblankStart(12 0). The 120 means it waits 120 cycles of the screen refreshing. So that means it waits 2 seconds, since the refreshing rate is 60 Hz.
    Yeah that's what I was thinking too. Oh yeah, Altair, I saw your post in the ps2dev site and I was wondering if you could tell me how you used a 1000x1000 image without any distortion or anything?

    Thanks.

  26. #2516
    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 ShockD
    Yeah that's what I was thinking too. Oh yeah, Altair, I saw your post in the ps2dev site and I was wondering if you could tell me how you used a 1000x1000 image without any distortion or anything?

    Thanks.

    its not possible to load images greater than 480x272 in luaplayer unless there is a version i dont know about. youll just have to make seperate images i guess.
    --------------------------------------------------------------------------------------

  27. #2517
    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

    hi, i have an analog problem. here is my code:
    Code:
    function movePlayer()
    
    pad = Controls.read()
    
    dx = pad:analogX()
    
    if math.abs(dx) < -100 then
    Player[1].x = Player[1].x - 5 
    playerpic = 1
    goingf = true
    
    elseif math.abs(dx) > 120 then
    Player[1].x=Player[1].x + 5
    playerpic = 2
    goingb = true
    end
    
    end
    when i move the analog nub right then player goes right, BUT when i move it left, the player STILL goes right. help.
    --------------------------------------------------------------------------------------

  28. #2518
    QJ Gamer Bronze
    Points: 5.744, Level: 48
    Level completed: 97%, Points required for next Level: 6
    Overall activity: 0%

    Registriert seit
    Aug 2005
    Ort
    Plainfield, IL USA
    Beiträge
    18
    Points
    5.744
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    its not possible to load images greater than 480x272 in luaplayer unless there is a version i dont know about. youll just have to make seperate images i guess.
    It's not possible to load an image greater than 512x512. Yeah that's exactly what I did so thanks anyway.

    ShockD

  29. #2519
    QJ Gamer Green
    Points: 13.310, Level: 75
    Level completed: 15%, Points required for next Level: 340
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Here
    Beiträge
    2.715
    Points
    13.310
    Level
    75
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    function movePlayer()
    
    pad = Controls.read()
    
    dx = pad:analogX()
    
    if math.abs(dx) < -100 then
    Player[1].x = Player[1].x - 5 
    playerpic = 1
    goingf = true
    
    elseif math.abs(dx) > 120 then
    Player[1].x=Player[1].x + 5
    playerpic = 2
    goingb = true
    end
    
    end
    the absolute value of "dx" should not be able to be less than negative100.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  30. #2520
    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 EminentJonFrost
    Code:
    function movePlayer()
    
    pad = Controls.read()
    
    dx = pad:analogX()
    
    if math.abs(dx) < -100 then
    Player[1].x = Player[1].x - 5 
    playerpic = 1
    goingf = true
    
    elseif math.abs(dx) > 120 then
    Player[1].x=Player[1].x + 5
    playerpic = 2
    goingb = true
    end
    
    end
    the absolute value of "dx" should not be able to be less than negative100.


    so how would i fix it. sry, im a total n00b at analog controls. it would have been much easier if it was like:

    Code:
    if analog:right() then
    ... blah
    but life aint fair. thx for the help!
    --------------------------------------------------------------------------------------


 

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 08:58 PM Uhr.

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