Seite 81 von 342 ErsteErste ... 31 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 131 181 ... LetzteLetzte
Zeige Ergebnis 2.401 bis 2.430 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; >.< , it freezes at checking your connecting...

  
  1. #2401
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    >.< , it freezes at checking your connecting


    Bequiet!!!
    I'm learning cc©cc

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

    Zitat Zitat von PSPduh
    I am having trouble with this code. I get the error: index.lua 28 'then' expected near '='. :Argh: :Argh: :Argh: The code:
    Code:
    red = Color.new(255,0,0)
    yellow = Color.new(255, 255, 0)
    blue = Color.new(0, 0, 255)
    orange = Color.new(223, 88, 6)
    grey = Color.new(94, 97, 111)
    black = Color.new(0, 0, 0)
    white = Color.new(255, 255, 255)
    green = Color.new(0,255,0)
    
    duh = Timer.new()
    duh2 = duh:time()
    x = 470
    y = 0
    duh:start()
    
    man = Image.load("man.png")
    
    while true do
    screen:clear(white)
    
    if duh2 >= 470 then
    screen:blit(470,0,man)
    end
    
    screen:blit(x,y,man)
    
    for i = 1, 470 do
    if duh2 == i * 1 then
    man.x = man.x + 1
    end
    
    screen.waitVblankStart()
    screen.flip()
    end
    The line that is bolded is line 28.
    This should work. If you check if two things are equal, you have to use "==" not "=".
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  3. #2403
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    yeah, i got this Audacity audio recorder, its really cool, you can edit and take out some audio you dont want =P
    Bequiet!!!
    I'm learning cc©cc

  4. #2404
    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

    hey quyick informational answer...

    Does netlib atually create an array/sturcture of the Connection Info meaning like it will give you the IP Address of the Connection Name and the DNS and Subnet Mask adn such?

    Also, i doubt this but can netlib 'create' connections? like add 1 to the connections info integer and create the connection?

    Basically, does the NETLIB connection function return the connection info? If so, is creating a connection possible if you add 1 to the connections array/structure

    Im guessing NO because the LuaPlayer source may not have added WLAN Connetions Manipulatyion :-(

    ...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


  5. #2405
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    guys, a simple question:


    is there a max of duped pictures in luaplayer v16 ?
    becuase i m in an amount that it lags the player1 movement if i put 1 more picture and i need to add alot more to finish the game
    Bequiet!!!
    I'm learning cc©cc

  6. #2406
    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

    Zitat Zitat von SG57
    hey quyick informational answer...

    Does netlib atually create an array/sturcture of the Connection Info meaning like it will give you the IP Address of the Connection Name and the DNS and Subnet Mask adn such?

    Also, i doubt this but can netlib 'create' connections? like add 1 to the connections info integer and create the connection?

    Basically, does the NETLIB connection function return the connection info? If so, is creating a connection possible if you add 1 to the connections array/structure

    Im guessing NO because the LuaPlayer source may not have added WLAN Connetions Manipulatyion :-(
    First thing Im not sure. I never tried, I just used what the wlan example in LUAplayer used. Maybe you could make it print all that it returns?

    NETLIB cant create any connections. Im not sure if LUA can, but i dont think so.
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  7. #2407
    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 natan333
    guys, a simple question:


    is there a max of duped pictures in luaplayer v16 ?
    becuase i m in an amount that it lags the player1 movement if i put 1 more picture and i need to add alot more to finish the game

    post your player moving code, ther is something probably wrong with it. you can load a LOT of images, about 24mb i think, but im not 100% sure.
    --------------------------------------------------------------------------------------

  8. #2408
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    post your player moving code, ther is something probably wrong with it. you can load a LOT of images, about 24mb i think, but im not 100% sure.
    Code:
    if pad:up() and moving1 == true then
    move:start()
    screen:clear(white)
    y0 = y0 - 2
    screen:blit(x0, y0, up1)
    end
    
    if pad:up() and moving1 == true and move:time() > 0 then
    screen:clear(white)
    screen:blit(x0, y0, up2)
    end
    
    if pad:up() and moving1 == true and move:time() > 150 then
    screen:clear(white)
    screen:blit(x0, y0, up1)
    end
    
    if pad:up() and moving1 == true and move:time() > 300 then
    move:reset()
    end
    This is when its going up


    ~EDIT~ I toke off the top screen:clear from the code above, it fixes but picture dosent look right


    Code:
    if pad:up() and move:start() and moving1 == true then
    screen:clear(white)
    y0 = y0 - 2
    screen:blit(x0, y0, up2)
    end
    
    if pad:up() and moving1 == true and move:time() > 150 then
    screen:clear(white)
    screen:blit(x0, y0, up1)
    end
    
    if pad:up() and moving1 == true and move:time() > 300 then
    move:reset()
    end
    ok this is working better, but i wanna see if its going to lag again
    Geändert von natan333 (05-21-2006 um 06:45 AM Uhr)
    Bequiet!!!
    I'm learning cc©cc

  9. #2409
    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 need some more help here. Now I try this code:
    Code:
    red = Color.new(255,0,0)
    yellow = Color.new(255, 255, 0)
    blue = Color.new(0, 0, 255)
    orange = Color.new(223, 88, 6)
    grey = Color.new(94, 97, 111)
    black = Color.new(0, 0, 0)
    white = Color.new(255, 255, 255)
    green = Color.new(0,255,0)
    
    duh = Timer.new()
    duh2 = duh:time()
    x = 39
    y =41
    duh:start()
    
    man = Image.load("man.png")
    
    while true do
    screen:clear(white)
    
    if duh2 >= 470 then
    screen:blit(39,41,man)
    end
    
    screen:blit(x,y,man)
    
    for i = 1, 470 do
    if duh2 == i * 1 then
    man.x = man.x + 1
    end
    end
    
    screen.waitVblankStart()
    screen.flip()
    end
    It gives a luaplayer.exe.stackdump file. And in that file is:
    Code:
    Stack trace:
    Frame     Function  Args
      57363 [sig] luaplayer 3364 handle_threadlist_exception: handle_threadlist_exception called with threadlist_ix -1
      65521 [sig] luaplayer 3364 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
    Exception: STATUS_ACCESS_VIOLATION at eip=61015E82
    eax=7C802542 ebx=610E7ECC ecx=00000000 edx=0000001B esi=00000000 edi=00000001
    ebp=00A2E6E8 esp=00A2E6E4 program=C:\Documents and Settings\FattyMcFat\Desktop\luaplayer.exe, pid 3364, thread sig
    cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
    Stack trace:
    Frame     Function  Args
    00A2E6E8  61015E82  (610E7ECC, 0022E598, 00000001, 00000000)
    00A2E708  61015FAC  (00000001, 00A2E760, 00000000, 00000000)
    00A2EA58  610179AB  (000006F4, 00A2EED0, 000000A4, 00A2EE9C)
    00A2EF98  6108A497  (610E6D18, 00000000, 00000F84, 00000000)
    00A2EFC8  6100327F  (610E6D18, 00A2F000, 61003160, 00000000)
    00A2EFF8  61003E94  (00000000, 00000000, 00000000, 00000000)
    00A2FF98  61003EDA  (00000000, 00000000, 00000000, 00000000)
    End of stack trace
    Grrrr...If this code would work, I could make a game or two. Thank you for your help. :)

  10. #2410
    Points: 10.633, Level: 68
    Level completed: 46%, Points required for next Level: 217
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    second star to the right...
    Beiträge
    139
    Points
    10.633
    Level
    68
    Downloads
    0
    Uploads
    0

    Standard

    Quick Question... How can i make screenprint text ect rotait to a certain angle, say 180o so it wounld print up side down or 90o so it prints to the right?

    i'm stuck on this one :icon_sad:

    anybody got the knoledge.
    Geändert von Tiboric (05-21-2006 um 08:45 AM Uhr)

  11. #2411
    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 Tiboric
    Quick Question... How can i make screenprint text ect rotait to a certain angle, say 180o so it wounld print up side down or 90o so it prints to the right?

    i'm stuck on this one :icon_sad:

    anybody got the knoledge.
    This is a copy and paste from the "rotate" example in the new Luaplayer. (which is version 0.19)

    I'm learning this myself so I cant explain it to you, but I thought it'd be helpful to you (and others learning the same thing) if I posted it.

    Code:
    function rotate(image)
    	local w = image:width()
    	local h = image:height()
    	local result = Image.createEmpty(h, w)
    	for x=0,w-1 do
    		for y=0,h-1 do
    			result:pixel(h-y-1, x, image:pixel(x, y))
    		end
    	end
    	return result
    end
    
    function printRotated(x, y, text, color, image, rotateIndex)
    	rotateIndex = math.mod(rotateIndex, 4)
    	local w = string.len(text)
    	local result = Image.createEmpty(w * 8, 8)
    	result:print(0, 0, text, color)
    	if rotateIndex > 0 then
    		rotateIndex = rotateIndex - 1
    		for i=0,rotateIndex do
    			result = rotate(result)
    		end
    	end
    	image:blit(x, y, result)
    end
    
    cadetBlue = Color.new(95, 158, 160)
    
    printRotated(132, 0, "Don't ask what Lua Player", cadetBlue, screen, 0)
    printRotated(472, 76, "can do for you,", cadetBlue, screen, 1)
    printRotated(160, 264, "ask what you can do", cadetBlue, screen, 2)
    printRotated(0, 76, "for Lua Player!", cadetBlue, screen, 3)
    screen.flip()
    while true do
    	screen.waitVblankStart()
    end
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  12. #2412
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    guys. i have this question that it will be easier if it works

    i have a
    Code:
    blockx1 = 0
    blocky1 = 0
    all the way to
    Code:
    blockx62 = 16
    blocky62 = 480
    (the values are different though)

    and a
    Code:
    screen:blit(blockx1, blocky1, block)
    all the way to
    Code:
    screen:blit(blockx62, blocky62, block)
    .
    Is it possible to make them all move in the same speed with only 1 code like
    Code:
     blankx1 = blankx1 + 2
    or
    Code:
     blanky1 = blanky1 + 2
    ?
    Geändert von natan333 (05-21-2006 um 09:57 AM Uhr)
    Bequiet!!!
    I'm learning cc©cc

  13. #2413
    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 natan333
    guys. i have this question that it will be easier if it works

    i have a
    Code:
    blockx1 = 0
    blocky1 = 0
    all the way to
    Code:
    blockx62 = 16
    blocky62 = 480
    (the values are different though)

    and a
    Code:
    screen:blit(blockx1, blocky1, block)
    all the way to
    Code:
    screen:blit(blockx62, blocky62, block)
    .
    Is it possible to make them all move in the same speed with only 1 code like
    Code:
     blankx1 = blankx1 + 2
    or
    Code:
     blanky1 = blanky1 + 2
    ?

    it would be easier to make an array:
    Code:
    block = {}
    
    block[1] = { x = 0, y = 0 )
    ....all the way to 62
    then to blit all the blocks in THREE lines of code, do this:

    Code:
    for a = 1, 62 do
    screen:blit(block[a].x, block[a].y, block)
    end
    now for the moving part:

    Code:
    for b = 1, 62 do
    
    block[b].x = block[b].x + 2
    
    -- or if you want the y to move:
    
    block[b].y = block[b].y + 2
    
    --or if you want both x and y to move:
    
    block[b].x = block[b].x + 2
    block[b].y = block[b].y + 2
    
    end

    hope i helped!
    --------------------------------------------------------------------------------------

  14. #2414
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    thx, i think it will help alot

    but wait.
    in
    "block[1] = { x = 0, y = 0 )"

    wich one is the right one? the { or the ( so i dont have edit all over again
    Bequiet!!!
    I'm learning cc©cc

  15. #2415
    TheMarioKarters
    Guest

    Standard

    Zitat Zitat von natan333
    thx, i think it will help alot

    but wait.
    in
    "block[1] = { x = 0, y = 0 )"

    wich one is the right one? the { or the ( so i dont have edit all over again
    The {

  16. #2416
    Quality Haxing Since 1991
    Points: 29.255, Level: 99
    Level completed: 55%, Points required for next Level: 745
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Pennsylvania, USA Fi
    Beiträge
    6.206
    Points
    29.255
    Level
    99
    Downloads
    0
    Uploads
    0

    Standard

    {

    is the correct one.

    EDIT: Nice edit, TMK. I caught you....
    Zitat Zitat von Noriko
    I would call you gay but I love you.


    Wait ...huh.



  17. #2417
    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 natan333
    thx, i think it will help alot

    but wait.
    in
    "block[1] = { x = 0, y = 0 )"

    wich one is the right one? the { or the ( so i dont have edit all over again
    yea, its { , i made a typo. also, if you are making you x and y values random, like:
    Code:
    block[1] = { x = math.random(100), y = math.random(100) }
    then you can also do:

    Code:
    for c = 1, 62 do
    block[c] = { x = math.random(100), y = math.random(100) } 
    end
    so you wont have to make a huge list.
    --------------------------------------------------------------------------------------

  18. #2418
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    thx guys =P

    the random is sweet, i will use it later =P

    is there another code instead of
    Code:
    for c = 1, 62 do
    block[c] = { x = math.random(480), y = 0 } 
    end
    to add 16 pixels after each pixel

    example:
    block[1] = { x = 0, y = 0 }
    block[2] = { x = 16, y = 0 }
    block[3] = { x = 32, y = 0 }
    block[4] = { x = 48, y = 0 }

    and so on?
    Bequiet!!!
    I'm learning cc©cc

  19. #2419
    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:
    for c = 1, 62 do
    block[c] = { x = x + 16, y = y + 16 } 
    end
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  20. #2420
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von EminentJonFrost
    Code:
    for c = 1, 62 do
    block[c] = { x = x + 16, y = y + 16 } 
    end

    that gave me error :icon_sad:
    Bequiet!!!
    I'm learning cc©cc

  21. #2421
    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:
    for c = 1, 62 do
    block[c].x = block[c].x + 16
    block[c].y = block[c].y + 16
    end
    my bad, try that.
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  22. #2422
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    still error hmm
    Bequiet!!!
    I'm learning cc©cc

  23. #2423
    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

    whats the error?
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  24. #2424
    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 natan333
    thx guys =P

    the random is sweet, i will use it later =P

    is there another code instead of
    Code:
    for c = 1, 62 do
    block[c] = { x = math.random(480), y = 0 } 
    end
    to add 16 pixels after each pixel

    example:
    block[1] = { x = 0, y = 0 }
    block[2] = { x = 16, y = 0 }
    block[3] = { x = 32, y = 0 }
    block[4] = { x = 48, y = 0 }

    and so on?

    try this:

    Code:
    block = {}
    
    block[1] = { x = 0, y = 0 }
    
    for d = 2, 62 do
    block[d] = { x = block[d-1].x + 16, y = 0 }
    end
    that SHOULD work.
    --------------------------------------------------------------------------------------

  25. #2425
    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
    whats the error?

    the problem was that you said to get just "x". there is no value as "x", only as
    Code:
    block[1-62].x

    P.S. sry for double post
    --------------------------------------------------------------------------------------

  26. #2426
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Thx so much Grimfate126 :Jump:
    Bequiet!!!
    I'm learning cc©cc

  27. #2427
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    need help in this one

    I toke some time to find out how to make the picture "blockk" block all sides when player1 tryes to get in but now i tested it, only 1 block works, the others blocks dosent block "player1" so it pass through block[1] and [2] but not [3]

    Code:
    block = {}
    block[1] = { x = 32 , y = 32 } 
    block[2] = { x = 64 , y = 100 } 
    block[3] = { x = 100 , y = 130 } 
    
    it works only with the last block
    
    while true do
    
    blahblahblah and blahblahblah 
    
    
    for c = 1, 3 do
    screen:blit(block[c].x, block[c].y, blockk)
    
    if x0 >= block[c].x-13 and x0 <= block[c].x+15 and y0 >= block[c].y-16 and y0 <= block[c].y and bug11 == true then
    moving2 = false
    moving1 = true
    end
    
    
    if x0 >= block[c].x-13 and x0 <= block[c].x+15 and y0 >= block[c].y and y0 <= block[c].y+16 and bug22 == true then
    moving1 = false
    moving2 = true
    end
    
    
    if x0 >= block[c].x and x0 <= block[c].x+16 and y0 >= block[c].y-15 and y0 <= block[c].y+15 and bug33 == true then
    moving3 = false
    moving4 = true
    end
    
    
    if x0 >= block[c].x-15 and x0 <= block[c].x and y0 >= block[c].y-15 and y0 <= block[c].y+15 and bug44 == true then
    moving4 = false
    moving3 = true
    end
    
    -------------->Buggykiller
    if moving1 == false and x0 >= block[c].x+16 then
    moving1 = true
    end
    
    if moving1 == false and x0+16 <= block[c].x then
    moving1 = true
    end
    
    if moving2 == false and x0 >= block[c].x+16 then
    moving2 = true
    end
    
    if moving2 == false and x0+16 <= block[c].x then
    moving2 = true
    end
    --
    if moving3 == false and y0 >= block[c].y+16 then
    moving3 = true
    end
    
    
    if moving3 == false and y0+16 <= block[c].y then
    moving3 = true
    end
    
    
    if moving4 == false and y0 >= block[c].y+16 then
    moving4 = true
    end
    
    
    if moving4 == false and y0+16 <= block[c].y then
    moving4 = true
    end
    end
    payattention bellow while true do and above buggy killer, becuase that is what makes picture player1 stop when it tries to get inside block picture.
    how can i make it to work with block[1] and block[2]?
    Geändert von natan333 (05-21-2006 um 06:47 PM Uhr)
    Bequiet!!!
    I'm learning cc©cc

  28. #2428
    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

    if i really understood your quetion/problem then i could help lol... I just say use collision, not the whole X and Y co-ordinate checking adn booling...

    ...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


  29. #2429
    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 natan333
    need help in this one

    I toke some time to find out how to make the picture "blockk" block all sides when player1 tryes to get in but now i tested it, only 1 block works, the others blocks dosent block "player1" so it pass through block[1] and [2] but not [3]

    Code:
    block = {}
    block[1] = { x = 32 , y = 32 } 
    block[2] = { x = 64 , y = 100 } 
    block[3] = { x = 100 , y = 130 } 
    
    it works only with the last block
    
    while true do
    
    blahblahblah and blahblahblah 
    
    
    for c = 1, 3 do
    screen:blit(block[c].x, block[c].y, blockk)
    
    if x0 >= block[c].x-13 and x0 <= block[c].x+15 and y0 >= block[c].y-16 and y0 <= block[c].y and bug11 == true then
    moving2 = false
    moving1 = true
    end
    
    
    if x0 >= block[c].x-13 and x0 <= block[c].x+15 and y0 >= block[c].y and y0 <= block[c].y+16 and bug22 == true then
    moving1 = false
    moving2 = true
    end
    
    
    if x0 >= block[c].x and x0 <= block[c].x+16 and y0 >= block[c].y-15 and y0 <= block[c].y+15 and bug33 == true then
    moving3 = false
    moving4 = true
    end
    
    
    if x0 >= block[c].x-15 and x0 <= block[c].x and y0 >= block[c].y-15 and y0 <= block[c].y+15 and bug44 == true then
    moving4 = false
    moving3 = true
    end
    
    -------------->Buggykiller
    if moving1 == false and x0 >= block[c].x+16 then
    moving1 = true
    end
    
    if moving1 == false and x0+16 <= block[c].x then
    moving1 = true
    end
    
    if moving2 == false and x0 >= block[c].x+16 then
    moving2 = true
    end
    
    if moving2 == false and x0+16 <= block[c].x then
    moving2 = true
    end
    --
    if moving3 == false and y0 >= block[c].y+16 then
    moving3 = true
    end
    
    
    if moving3 == false and y0+16 <= block[c].y then
    moving3 = true
    end
    
    
    if moving4 == false and y0 >= block[c].y+16 then
    moving4 = true
    end
    
    
    if moving4 == false and y0+16 <= block[c].y then
    moving4 = true
    end
    end
    payattention bellow while true do and above buggy killer, becuase that is what makes picture player1 stop when it tries to get inside block picture.
    how can i make it to work with block[1] and block[2]?

    umm.. say WHAT??
    --------------------------------------------------------------------------------------

  30. #2430
    Points: 5.745, Level: 48
    Level completed: 98%, Points required for next Level: 5
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Beiträge
    404
    Points
    5.745
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    ok i think this better.

    is the block picture and its named blockk.
    there is moving picture called "player1" somewhere and it have moving1 == true (to go up), moving2 == true (go down) , moving3 == true (go left) and moving4 == true (go right) like

    Code:
    if pad:up() and move:start() and moving1 == true then
    screen:clear(white)
    y0 = y0 - 2
    screen:blit(x0, y0, up2)
    end
    
    if pad:up() and moving1 == true and move:time() > 150 then
    screen:clear(white)
    screen:blit(x0, y0, up1)
    end
    
    if pad:up() and moving1 == true and move:time() > 300 then
    move:reset()
    end
    is one of them

    so this code bellow tells one of the moving1-4 to be false if the moving "player1" tries to go through the block picture
    from above, bellow and sides

    Code:
    for c = 1, 3 do
    screen:blit(block[c].x, block[c].y, blockk)
    
    if x0 >= block[c].x-13 and x0 <= block[c].x+15 and y0 >= block[c].y-16 and y0 <= block[c].y and bug11 == true then
    moving2 = false
    moving1 = true
    end
    
    
    if x0 >= block[c].x-13 and x0 <= block[c].x+15 and y0 >= block[c].y and y0 <= block[c].y+16 and bug22 == true then
    moving1 = false
    moving2 = true
    end
    
    
    if x0 >= block[c].x and x0 <= block[c].x+16 and y0 >= block[c].y-15 and y0 <= block[c].y+15 and bug33 == true then
    moving3 = false
    moving4 = true
    end
    
    
    if x0 >= block[c].x-15 and x0 <= block[c].x and y0 >= block[c].y-15 and y0 <= block[c].y+15 and bug44 == true then
    moving4 = false
    moving3 = true
    end
    end
    like, the block[c] is added becuase later, the game will move them all atomatically

    the code above works great but the problem, it only worked for block[3] but not block[1] and block[2]
    Geändert von natan333 (05-21-2006 um 07:17 PM Uhr)
    Bequiet!!!
    I'm learning cc©cc


 

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

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