Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: I'm Learning Lua

                  
   
  1. #11
    DCEmu Legend dejkirkby's Avatar
    Join Date
    Feb 2006
    Age
    45
    Posts
    2,632
    Rep Power
    101

    Default

    Cool. Well done dude. Keep learning and you will get better.:thumbup:

  2. #12
    DCEmu Old Pro
    Join Date
    May 2006
    Posts
    1,073
    Rep Power
    75

    Default

    Splodger, would you be able to help me clear my lua script up? I'm trying to make it use up as little memory as possible, but dont know what else i would need to do (most memory is taken up by the pictures though)

    P.S. Sorry for hijacking this thread scotty
    P.S.S. Is there a 'frogger' port to the PSP, or would i have to play it through an emulator?

  3. #13
    DCEmu Pro scottyboynow's Avatar
    Join Date
    May 2006
    Location
    UK
    Age
    30
    Posts
    641
    Rep Power
    72

    Default

    It's okay. I dont know About The Frogger Port Thought

  4. #14
    DCEmu Coder splodger15's Avatar
    Join Date
    Jun 2006
    Location
    London
    Age
    34
    Posts
    4,123
    Rep Power
    95

    Default

    Everything seems ok Jak although i might need your help for a cursor in Where's Sora.Here is the script for it

    LimeGreen = Color.new(50, 205, 50)
    Background = Image.load("images/MENU.PNG")
    Black = Color.new(0, 0, 0)
    Red = Color.new(255, 0, 0)
    menu = true


    pic = {}
    pic[1] = Image.load("images/1.PNG")
    pic1 = {}
    pic1.w = 42 --width
    pic1.h =27 --height
    pic1.x = 230 --x val
    pic1.y = 114 --y val
    --pic[2] = Image.load("images/2.PNG")
    pic2 ={}
    pic2.w = 42
    pic2.h = 14
    pic2.x = 173
    pic2.y = 84
    --pic[3] = Image.load("images/3.PNG")
    pic3 ={}
    pic3.w =21
    pic3.h=21
    pic3.x=173
    pic3.y=172
    --pic[4] = Image.load("images/4.PNG")
    pic4 ={}
    pic4.w =24
    pic4.h =41
    pic4.x =153
    pic4.y =94
    --pic[5] = Image.load("images/5.PNG")
    pic5 ={}
    pic5.w= 480
    pic5.h= 272
    pic5.x= 0
    pic5.y= 0
    --pic[6] = Image.load("images/6.PNG")
    pic6 ={}
    pic6.w=42
    pic6.h=24
    pic6.x=187
    pic6.y=30
    --pic[7] = Image.load("images/7.PNG")
    pic7 ={}
    pic7.w=16
    pic7.h=23
    pic7.x=312
    pic7.y=174


    -----Loads images--------


    ------Loading Screen--------

    screenrint(194, 136, "Loading 8%", LimeGreen)
    screen:flip()

    screen:clear()
    screenrint(194, 136, "Loading 23%", LimeGreen)
    screen:flip()

    screen:clear()
    screenrint(194, 136, "Loading 38%", LimeGreen)
    screen:flip()

    screen:clear()
    screenrint(194, 136, "Loading 44%", LimeGreen)
    screen:flip()

    screen:clear()
    screenrint(194, 136, "Loading 56%", LimeGreen)
    screen:flip()

    screen:clear()
    screenrint(194, 136, "Loading 61%", LimeGreen)
    screen:flip()

    screen:clear()
    screenrint(194, 136, "Loading 79%", LimeGreen)
    screen:flip()

    screen:clear()
    screenrint(194, 136, "Loading 88%", LimeGreen)
    screen:flip()

    screen:clear()
    screenrint(194, 136, "Loading 95%", LimeGreen)
    screen:flip()

    screen:clear()
    screenrint(194, 136, "Loading 100%", LimeGreen)
    screen:flip()

    screen.waitVblankStart(240)


    while true do

    while menu == true do

    current = 1
    oldpad = Controls.read()

    --while true do

    pad = Controls.read()
    screen:clear()

    ----prints to the screen-------
    screen:blit(0, 0, Background)
    screenrint(200, 130, "Start game", Black)
    screenrint(200, 140, "Instructions", Black)
    screenrint(200, 150, "Credits", Black)
    screenrint(130, 230, "To exit press the Home button", Black)

    -----this code is so that when you highlight an option in a menu it turns red-----
    if current == 1 then
    screenrint(200, 130, "Start game", Red)
    end

    if current == 2 then
    screenrint(200, 140, "Instructions", Red)
    end

    if current == 3 then
    screenrint(200, 150, "Credits", Red)
    end


    -----this makes it so that you can scroll through your menu----
    if pad:up() and oldpad:up() ~= pad:up() then
    current = current-1
    end

    if pad:down() and oldpad:down() ~= pad:down() then
    current = current+1
    end

    if current == 4 then
    current = 1
    end

    if current == 0 then
    current = 3
    end

    -----this is to select your menu options------
    if pad:cross() then
    menu = false
    end


    screen.waitVblankStart()
    screen:flip()
    oldpad = pad
    --end
    end -- menu


    if current == 1 then
    cnt = 1
    while true do
    screen:clear()
    Image:fillRect(x,y,5,5,Red)
    screen:flip()
    pad = Controls.read()
    if pad~= oldpad then
    -- if pad:cross() and then cnt = cnt + 1 end
    if pad:start() then
    menu = true
    break
    end
    if pad:left() then x = x-1 end
    if pad:right() then x = x+1 end
    if pad:up() then y = y - 1 end
    if pad:down() then y = y +1 end
    if (x > pic..tostring(cnt).x) and (x < pic..tostring(cnt).x+pic..tostring(cnt).w) and (y > pic..tostring(cnt).y)
    and (y < pictostring(cnt).y+pictostring(cnt).h) and(pad:cross()) then
    cnt = cnt+1

    end
    oldpad = pad
    end
    if pic[cnt] then
    pic[cnt] = Image.load("images/"..tostring(cnt)..".png")
    -- screen:blit(x,y,curser)

    screen:blit(0,0,pic[cnt])
    screen:flip()
    else
    screenrint(0,0,"Compleated",red)
    break
    end
    screen:flip()
    end

    end
    end -- if current = 1

    if current == 2 then
    instructions = Image.load("images/instructions.png")
    while true do

    pad = Controls.read()
    screen:blit(0, 0, instructions)
    if pad:square() then
    menu = true
    break
    end
    screen:flip()
    end
    end

    if current == 3 then
    credits = Image.load("images/credits.png")
    while true do

    pad = Controls.read()
    screen:blit(0, 0, credits)

    if pad:square() then
    menu = true
    break
    end
    screen:flip()
    end


    end

    PSN ID: splodger15

  5. #15
    DCEmu Old Pro
    Join Date
    May 2006
    Posts
    1,073
    Rep Power
    75

    Default

    thats cool, just PM me if/when you need help

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •