Seite 161 von 342 ErsteErste ... 61 111 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 211 261 ... LetzteLetzte
Zeige Ergebnis 4.801 bis 4.830 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; Zitat von emericaska8r hey sorry for being off topic here, but how do you change what it says under your ...

  
  1. #4801
    QJ Gamer Silver
    Points: 10.921, Level: 69
    Level completed: 18%, Points required for next Level: 329
    Overall activity: 0%

    Registriert seit
    May 2006
    Ort
    Behind you.
    Beiträge
    1.814
    Points
    10.921
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von emericaska8r
    hey sorry for being off topic here, but how do you change what it says under your picture when you post? because mine just says novice, and thats gay.
    lol, you need dev status. Funny thing is mine said "Neophyte" (even though i think it still should for now).

    Also, about that, i am pming a moderator or administrator about that to get it removed...


    Calypso - Enjoy the excellent 2D space shooter:
    http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195

    "Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)

  2. #4802
    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

    oh, yea and like i just deposited all my points to the bank, and now it says i don't have enough points to enter the bank anymore. thats so gay

  3. #4803
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Yea, You need to have 50 to enter it.

  4. #4804
    QJ Gamer Silver
    Points: 10.921, Level: 69
    Level completed: 18%, Points required for next Level: 329
    Overall activity: 0%

    Registriert seit
    May 2006
    Ort
    Behind you.
    Beiträge
    1.814
    Points
    10.921
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    Ahem.......Sorry it was my fault to start this off topic; this is a lua help thread. Lol....
    Calypso - Enjoy the excellent 2D space shooter:
    http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195

    "Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)

  5. #4805
    Look at my user title :p
    Points: 14.103, Level: 77
    Level completed: 14%, Points required for next Level: 347
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Texas
    Beiträge
    1.183
    Points
    14.103
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    i fixed my other error and now am wondering a question i defined player width and player height like this:
    Code:
    player:width()
    player:height()
    but in the collision function i need to use player width also how do i call the variables if they look like the above code? or do i need to assign new varibales and assign them the dimensions of the image?

    --edit--
    also i calls other variables such as (variable name).width how do I need to assign those as well?
    Geändert von %chrono trigger% (12-22-2006 um 10:18 PM Uhr)

  6. #4806
    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 %chrono trigger%
    i fixed my other error and now am wondering a question i defined player width and player height like this:
    Code:
    player:width()
    player:height()
    but in the collision function i need to use player width also how do i call the variables if they look like the above code? or do i need to assign new varibales and assign them the dimensions of the image?

    --edit--
    also i calls other variables such as (variable name).width how do I need to assign those as well?

    you could do this:

    Code:
    if (player.x + player:width() > whatever) etc.

    but, its more efficient to do this:
    Code:
    pW = player:width()
    
    --in your collision function--
    
    if (player.x + pW > whatever) etc.

    that way, the psp doesnt spend time each frame checking the width of the player over and over again.
    --------------------------------------------------------------------------------------

  7. #4807
    Look at my user title :p
    Points: 14.103, Level: 77
    Level completed: 14%, Points required for next Level: 347
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Texas
    Beiträge
    1.183
    Points
    14.103
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    --edit--
    ok im moving rather smoothly now except when i added this to my code:
    Code:
    Jewel = {}
    Jewel[1] = {x=350,y=150,height = Jewel:height(), width = Jewel:width() }
    Jewel[2] = {x=150,y=100,height = Jewel:height(), width = Jewel:width() }
    Jewel[3] = {x=200,y=250,height = Jewel:height(), width = Jewel:width() }
    Jewel[4] = {x=300,y=120,height = Jewel:height(), width = Jewel:width() }
    Jewel[5] = {x=100,y=225,height = Jewel:height(), width = Jewel:width() }
    it gives me an error saying attemtp to call method 'height' (a nil value)
    Geändert von %chrono trigger% (12-22-2006 um 11:31 PM Uhr)

  8. #4808
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Well, seems to me like you don't have a 'Jewel' image created. Whether it be loaded via Image.load as an example, or created, via Image.createEmpty(n,n).

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  9. #4809
    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

    does anyone know a lua game with scrolling? i have scrolling down, its that in my game i create objects that i want for to STAY on the scrolling background. (example, throw a ...rock or something, it lands and stays, i move character, screen scrolls, rock disappears from screen, go back, rock reappears in the place it was thrown.) i just need to know if someone else has done this so i can get an idea of how to do it myself.

    so basically, does anyone know a game with scrolling and has newly created objects scroll with the map too?
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  10. #4810
    QJ Gamer Green
    Points: 6.520, Level: 52
    Level completed: 85%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Sweden
    Beiträge
    460
    Points
    6.520
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von EminentJonFrost
    does anyone know a lua game with scrolling? i have scrolling down, its that in my game i create objects that i want for to STAY on the scrolling background. (example, throw a ...rock or something, it lands and stays, i move character, screen scrolls, rock disappears from screen, go back, rock reappears in the place it was thrown.) i just need to know if someone else has done this so i can get an idea of how to do it myself.

    so basically, does anyone know a game with scrolling and has newly created objects scroll with the map too?
    You got to have two main axis, x and y.
    For example:
    Code:
    Screen.x = 0
    Screen.y = 0
    
    screen:blit(x+Screen.x,y+Screen.y,image) -- You can make this a function so you don't have to write the "+Screen.x" stuff over and over again.
    Now you make Screen.x and Screen.y togglable, then you can start to place out your sprites and stuff. Simple enugh?
    [CENTER]Some of my homebrew Applications/Games:
    [URL=http://forums.qj.net/showthread.php?t=47294&page=1&pp=10]Planet Fighter[/URL] | [URL=http://forums.qj.net/showthread.php?p=641672#post641672]Graphic Creator (V2.0)[/URL] | [URL=http://forums.qj.net/showthread.php?p=512717]Fire Pong[/URL] | [B][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html#post1430891"][COLOR="Red"][SIZE="3"]Brushes v2.0[/COLOR][/SIZE][/B][/URL] [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][B][SIZE="2"][COLOR="Black"]Released![/COLOR][/SIZE][/B][/URL]
    [URL="http://haxxblaster.2u.se/"][COLOR="black"][FONT="Arial Black"]www.HaxxBlaster.com[/FONT][/COLOR][/URL]

    [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][IMG]http://img19.imageshack.us/img19/1346/brushesbannerqz3.png[/IMG][/URL][/CENTER]

  11. #4811
    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

    i'm afraid not...whats making this difficult in my case is that, not only does the screen scroll, but the player can move (in a limited box, you can say) around too. so my object appears around my character and it moves how it should on-screen (like if my character goes up, it doesnt). but i want for it to stop, and be part of the background, which scrolls, so now my object must change from player-screen-based coordinates to map coordinates. its complicated...

    oh yes, my view is top-down.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  12. #4812
    QJ Gamer Green
    Points: 6.520, Level: 52
    Level completed: 85%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Ort
    Sweden
    Beiträge
    460
    Points
    6.520
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von EminentJonFrost
    i'm afraid not...whats making this difficult in my case is that, not only does the screen scroll, but the player can move (in a limited box, you can say) around too. so my object appears around my character and it moves how it should on-screen (like if my character goes up, it doesnt). but i want for it to stop, and be part of the background, which scrolls, so now my object must change from player-screen-based coordinates to map coordinates. its complicated...

    oh yes, my view is top-down.
    Yeah, i guessed your game was in a top-down view. I got a unfinnished game with sidescrolling, not top-down view, but it's nearly the same. I think you might want to have a look at it.
    MSN: [email protected]
    [CENTER]Some of my homebrew Applications/Games:
    [URL=http://forums.qj.net/showthread.php?t=47294&page=1&pp=10]Planet Fighter[/URL] | [URL=http://forums.qj.net/showthread.php?p=641672#post641672]Graphic Creator (V2.0)[/URL] | [URL=http://forums.qj.net/showthread.php?p=512717]Fire Pong[/URL] | [B][URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html#post1430891"][COLOR="Red"][SIZE="3"]Brushes v2.0[/COLOR][/SIZE][/B][/URL] [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][B][SIZE="2"][COLOR="Black"]Released![/COLOR][/SIZE][/B][/URL]
    [URL="http://haxxblaster.2u.se/"][COLOR="black"][FONT="Arial Black"]www.HaxxBlaster.com[/FONT][/COLOR][/URL]

    [URL="http://forums.qj.net/f-psp-development-forum-11/t-release-brushes-v20-99207.html"][IMG]http://img19.imageshack.us/img19/1346/brushesbannerqz3.png[/IMG][/URL][/CENTER]

  13. #4813
    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

    um, ok sure!

    edit - i added you. sorry for the delayed response, my internet acted wierd....
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  14. #4814
    Look at my user title :p
    Points: 14.103, Level: 77
    Level completed: 14%, Points required for next Level: 347
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Texas
    Beiträge
    1.183
    Points
    14.103
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    well this collision is really throwing me off. Can i create a empty image and then paste a .png file on it?

  15. #4815
    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 %chrono trigger%
    well this collision is really throwing me off. Can i create a empty image and then paste a .png file on it?
    that wouldnt do anything different. theres no point (that i know of) to blitting an image, in an image, when all you want is...the first image. post some code up, i'll see if i can be of assistance! :)
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  16. #4816
    Look at my user title :p
    Points: 14.103, Level: 77
    Level completed: 14%, Points required for next Level: 347
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Texas
    Beiträge
    1.183
    Points
    14.103
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    jeres the first half of my code:
    Code:
    red = Color.new(255,0,0)
    background = Image.load("b.png") 
    player = Image.load("a.png")
    jewel = Image.load("c.png")
    
    playerWidth = 50 
    playerHeight = 50
    
    screenwidth = 480 - player:width()
    screenheight = 272 - player:width()
    
    Player = {}
    Player[1] = {x=10,y=10}
    Background = {}
    Background[1] = {x=0,y=0}
    Jewel = {}
    Jewel[1] = {x=350,y=150, height = jewel:height(), width = jewel:width() }
    Jewel[2] = {x=150,y=100, height = jewel:height(), width = jewel:width() }
    Jewel[3] = {x=200,y=250, height = jewel:height(), width = jewel:width() }
    Jewel[4] = {x=300,y=120, height = jewel:height(), width = jewel:width() }
    Jewel[5] = {x=100,y=225, height = jewel:height(), width = jewel:width() }
    
    Jewel:height()
    Jewel:width()
    
    function collisionCheck(Jewel)
    if (Player[1].x + playerWidth > Jewel[1].x) and (Player[1].x < Jewel[1].x + Jewel[1].width) and (Player[1].y + playerHeight > Jewel[1].y) and (Player[1].y < Jewel[1].y + Jewel[1].height) then
    Player.x = oldx
    Player.y = oldy
    end 
    end
    
    function collisionCheck(Jewel)
    if (Player[1].x + playerWidth > Jewel[2].x) and (Player[1].x < Jewel[2].x + Jewel[2].width) and (Player[1].y + playerHeight > Jewel[2].y) and (Player[1].y < Jewel[2].y + Jewel[2].height) then
    Player.x = oldx
    Player.y = oldy
    end 
    end
    
    function collisionCheck(Jewel)
    if (Player[1].x + playerWidth > Jewel[3].x) and (Player[1].x < Jewel[3].x + Jewel[3].width) and (Player[1].y + playerHeight > Jewel[3].y) and (Player[1].y < Jewel[3].y + Jewel[3].height) then
    Player.x = oldx
    Player.y = oldy
    end 
    end
    
    function collisionCheck(Jewel)
    if (Player[1].x + playerWidth > Jewel[4].x) and (Player[1].x < Jewel[4].x + Jewel[4].width) and (Player[1].y + playerHeight > Jewel[4].y) and (Player[1].y < Jewel[4].y + Jewel[4].height) then
    Player.x = oldx
    Player.y = oldy
    end 
    end
    
    function collisionCheck(Jewel)
    if (Player[1].x + playerWidth > Jewel[5].x) and (Player[1].x < Jewel[5].x + Jewel[5].width) and (Player[1].y + playerHeight > Jewel[5].y) and (Player[1].y < Jewel[5].y + Jewel[5].height) then
    Player.x = oldx
    Player.y = oldy
    end 
    end

  17. #4817
    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:
    screenwidth = 480 - player:width() --did you MEAN to do this?
    screenheight = 272 - player:width()
    you put player:width twice..

    also, it could be confusing to have an image and an array both called 'player'. i know one is capitalized, and that it should work fine, but it could lead to problems later.

    i shortened this:

    Code:
    Jewel = {}
    for a = 1, 5 do
    Jewel[a] = {x=350,y=150, height = jewel:height(), width = jewel:width() }
    end
    in place of this:
    Code:
    Jewel = {}
    Jewel[1] = {x=350,y=150, height = jewel:height(), width = jewel:width() }
    Jewel[2] = {x=150,y=100, height = jewel:height(), width = jewel:width() }
    Jewel[3] = {x=200,y=250, height = jewel:height(), width = jewel:width() }
    Jewel[4] = {x=300,y=120, height = jewel:height(), width = jewel:width() }
    Jewel[5] = {x=100,y=225, height = jewel:height(), width = jewel:width() }
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  18. #4818
    Look at my user title :p
    Points: 14.103, Level: 77
    Level completed: 14%, Points required for next Level: 347
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Texas
    Beiträge
    1.183
    Points
    14.103
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    yes i did thats not the problem and disregard Jewel:height() and the width one they shouldnt be there

  19. #4819
    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 %chrono trigger%
    yes i did thats not the problem
    HERES the problem:

    Code:
    function collisionCheck(Jewel)
    if (Player[1].x + playerWidth > Jewel[1].x) and (Player[1].x < Jewel[1].x + Jewel[1].width) and (Player[1].y + playerHeight > Jewel[1].y) and (Player[1].y < Jewel[1].y + Jewel[1].height) then
    Player.x = oldx
    Player.y = oldy
    end 
    end
    remember how i shortened the part before? you announced the SAME function 5 times, so it only affected 1 jewel, since you kept changing which jewel number each time you defined it.

    try this:

    Code:
    function collisionCheck(Jewel)
    for a = 1, 5 do
    if (Player[a].x + playerWidth > Jewel[a].x) and (Player[a].x < Jewel[a].x + Jewel[a].width) and (Player[a].y + playerHeight > Jewel[a].y) and (Player[a].y < Jewel[a].y + Jewel[a].height) then
    Player.x = oldx
    Player.y = oldy
    end
    end 
    end
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  20. #4820
    Points: 3.957, Level: 40
    Level completed: 4%, Points required for next Level: 193
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    36
    Points
    3.957
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    ok I wasnt sure if i should post this in this thread or not but here it is:

    For school im doing a long term project on developing a program for the psp in c/c++.

    I thought i had longer than i had so i cant learn the amount of info i need in time.

    Basically is there a way that i can imbed a lua file in an eboot so that even if you open up the eboot you couldnt tell that its a lua file or w/e inside. This way i could just pretend its in c and i could make it better and get a better grade since im pretty good at lua

  21. #4821
    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 jamz1825
    ok I wasnt sure if i should post this in this thread or not but here it is:

    For school im doing a long term project on developing a program for the psp in c/c++.

    I thought i had longer than i had so i cant learn the amount of info i need in time.

    Basically is there a way that i can imbed a lua file in an eboot so that even if you open up the eboot you couldnt tell that its a lua file or w/e inside. This way i could just pretend its in c and i could make it better and get a better grade since im pretty good at lua
    i dont think so...but i dont know about eboots, so you'll want a second opinion.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  22. #4822
    Look at my user title :p
    Points: 14.103, Level: 77
    Level completed: 14%, Points required for next Level: 347
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Texas
    Beiträge
    1.183
    Points
    14.103
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    function collisionCheck(Jewel)
        local i = 1
        while i <=5 do
            if (Player[1].x + playerWidth > Jewel[i].x) and (Player[1].x < Jewel[i].x + Jewel[i].width) and (Player[1].y + playerHeight > Jewel[i].y) and (Player[1].y < Jewel[i].y + Jewel[i].height) then
                Player.x = oldx
                Player.y = oldy
            end 
            i = i +1
        end
    end
    therers my new optimized code so i dont have to many if statements but it gives me the error attempt to index field '?' (a nil value)

  23. #4823
    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 %chrono trigger%
    Code:
    function collisionCheck(Jewel)
        local i = 1
        while i <=5 do
            if (Player[1].x + playerWidth > Jewel[i].x) and (Player[1].x < Jewel[i].x + Jewel[i].width) and (Player[1].y + playerHeight > Jewel[i].y) and (Player[1].y < Jewel[i].y + Jewel[i].height) then
                Player.x = oldx
                Player.y = oldy
            end 
            i = i +1
        end
    end
    therers my new optimized code so i dont have to many if statements but it gives me the error attempt to index field '?' (a nil value)
    change every '1' in a these: [ ] to an 'i'. and it should work.
    also, put this: for i = 1, 5 do
    instead of: while i <=5 do
    it cycles the code with 'i' changing its values, therefore, affecting 5 jewels. it basically works the same, but you can code how you want. :)
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  24. #4824
    Look at my user title :p
    Points: 14.103, Level: 77
    Level completed: 14%, Points required for next Level: 347
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Texas
    Beiträge
    1.183
    Points
    14.103
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von %chrono trigger%
    Code:
    function collisionCheck(Jewel)
        local i = i
    for i = 1, 5 do
    while i <=5 do
            if (Player[1].x + playerWidth > Jewel[i].x) and (Player[1].x < Jewel[i].x + Jewel[i].width) and (Player[1].y + playerHeight > Jewel[i].y) and (Player[1].y < Jewel[i].y + Jewel[i].height) then
                Player.x = oldx
                Player.y = oldy
            end 
            i = i +i
        end
    end
    like that?
    -edit-
    i guess i did something wrong as i am getting another error

  25. #4825
    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:
    Code:
    function collisionCheck(Jewel)
    for i = 1, 5 do
            if (Player[i].x + playerWidth > Jewel[i].x) and (Player[i].x < Jewel[i].x + Jewel[i].width) and (Player[i].y + playerHeight > Jewel[i].y) and (Player[i].y < Jewel[i].y + Jewel[i].height) then
                Player.x = oldx
                Player.y = oldy
            end 
        end
    end
    :)
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  26. #4826
    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

    what does the:
    Code:
    local i = 1
    do?

  27. #4827
    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 emericaska8r
    what does the:
    Code:
    local i = 1
    do?

    'local' means that only the function you called it in can access the variable. for example, if i did this:

    Code:
    function BOB()
    
    local joe = 0
    
    end
    
    
    while true do
    
    joe = joe + 1
    
    end

    that would result in an error. but this:


    Code:
    function BOB()
    
    local joe = 0
    joe = joe + 1
    
    end
    
    
    while true do
    
    BOB()
    
    end
    that would work perfectly.
    --------------------------------------------------------------------------------------

  28. #4828
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    got a problem ( a stupid one at that), for some reason, in my 2d side scroller, when my charactor moves right and hits the midde of the screen, the background scrolls AND my character still moves forward, yet, when he goes left it works Perfectly, i dont understand, it was working good before, but I must have been stupid and put something in the code to make it stop working, i copied the left movement code to the right and configured it to the right animation but still no good, here is my movement code,

    Spoiler for code:
    Code:
    if pad:right() and santaX >= 200 and bg4.x > 0 then
        scroll = "true"
    	santaState = "runningR"
        santaDirection = "right"
    	bg1.x = bg1.x - 3
    	bg2.x = bg2.x - 3
    	bg3.x = bg3.x - 3
    	bg4.x = bg4.x - 3
    	else
    	scroll = "false"
    	end	
    
    	
    if pad:left() and santaX <= 155 and bg1.x < 0 then
        scroll = "true"
    	santaState = "runningL"
        santaDirection = "left"
    	bg1.x = bg1.x + 3
    	bg2.x = bg2.x + 3
    	bg3.x = bg3.x + 3
    	bg4.x = bg4.x + 3
    	else
    	scroll = "false"
    	end	
    
    	
    	
    if pad:right()  and santaX <= rightWall and scroll == "false" then
    	santaState = "runningR"
    	santaDirection = "right"
    	santaX = santaX + 4
    	end
    				
    if pad:left()  and santaX >= leftWall and scroll == "false" then
    	santaState = "runningL"
    	santaDirection = "left"
    	santaX = santaX - 4
    	end


    the 2 blocks of code in front are for when the player reaches the middle of the screen, he is "supposedly" stops going forward 4 pixels and the background starts to scroll, (supposedly cuz this doesn't happen for when you press right) the other two code is for when he reaches the end of the screens, it stops scrolling and he starts to walk normally and make sures to stop when he reaches the end of the screen. Help for this would be great, if you need the full code + resources then PM me, I am absilutly sure this is a really simple problem that i just cant find.

    thanks in advance, Later!

    -Jaws-
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  29. #4829
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Im too busy to look into that deeply, but give this try for your FIRST to if's there...
    Code:
    if pad:right() and santaX >= 200 and bg4.x > 0 then
    scroll = "true"
    santaState = "runningR"
    santaDirection = "right"
    santaX = 200
    bg1.x = bg1.x - 3
    bg2.x = bg2.x - 3
    bg3.x = bg3.x - 3
    bg4.x = bg4.x - 3
    else
    scroll = "false"
    end
    
    
    if pad:left() and santaX <= 155 and bg1.x < 0 then
    scroll = "true"
    santaState = "runningL"
    santaDirection = "left"
    santaX = 155
    bg1.x = bg1.x + 3
    bg2.x = bg2.x + 3
    bg3.x = bg3.x + 3
    bg4.x = bg4.x + 3
    else
    scroll = "false"
    end

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  30. #4830
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    Ahhh yup, that did , thanks again! (another reason to credit you:) )
    thanks man
    y i didn't think to simply state santa's X value is beyond me...

    thanks again :)
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.


 

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 .