Seite 20 von 342 ErsteErste ... 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 70 120 ... LetzteLetzte
Zeige Ergebnis 571 bis 600 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; ok i will post what i have right now, with images right?...

  
  1. #571
    QJ Gamer Green
    Points: 40.380, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Grand Line
    Beiträge
    5.996
    Points
    40.380
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    ok i will post what i have right now, with images right?


    [CENTER][IMG]http://img130.imageshack.us/img130/1640/acefcbanner2wo9.gif[/IMG]
    [SIZE=1][B]I'm soo hot[/B][/SIZE]
    [/CENTER]
    [SIZE=2][CENTER][/SIZE][/CENTER]
    [center]Sorry. No Advertising[/center]

  2. #572
    QJ Gamer Green
    Points: 40.380, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Grand Line
    Beiträge
    5.996
    Points
    40.380
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    http://kingofnoobs.6te.net/luasnippnet.zip

    you can get it there pspmillionare, (if you go to the site (which isnt finisihed) could you click the ad for me :))
    [CENTER][IMG]http://img130.imageshack.us/img130/1640/acefcbanner2wo9.gif[/IMG]
    [SIZE=1][B]I'm soo hot[/B][/SIZE]
    [/CENTER]
    [SIZE=2][CENTER][/SIZE][/CENTER]
    [center]Sorry. No Advertising[/center]

  3. #573
    QJ Gamer Bronze
    Points: 5.975, Level: 50
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Alabama
    Beiträge
    272
    Points
    5.975
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    k, i'll check it out.
    My lua tutorials for PSP - www.evilmana.com/tutorials
    PSP Lua CodeBase - Add your own code examples to the codebase! - www.evilmana.com/tutorials/codebase/

  4. #574
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    ok ive ran into an error. ive gotten everything done(exept collision) but ow i get trhis error

    Index.lua:120: calling 'blit' on bad self (number expected, got nil)

    the thing is i have it calling a cariablke as the x cordinats but thats what its giving me the error for. even though i have the variable already assigned.

    the error is part of the pole creator so ill just post that part

    Code:
    --Pole Creation
    if rc==1 then
    	if NP==0 then
      	if math.random(0, 1)==0 then I1=1 NP=1 rc=0 else I1=2 NP=1 rc=0 end
    	end
    	if NP==1 then
    	if math.random(0, 1)==0 then I2=1 NP=2 rc=0 else I2=2 NP=2 rc=0 end
    	end
    	if NP==2 then
    	if math.random(0, 1)==0 then I3=1 NP=3 rc=0 else I3=2 NP=3 rc=0 end
    	end
    	if NP==3 then
    	if math.random(0, 1)==0 then I4=1 NP=4 rc=0 else I4=2 NP=4 rc=0 end
    	end
    end
    
    --Pole Timer
    if rc==0 then ct=ct+ps end
    if ct==12 then ct=0 rc=1 end
    	
    --Pole Images
    
    if I1==1 then
    	p1=p1-ps
    	screen:blit(p1, 170, Obj)
    end
    if I1==2 then
    	screen:blit(p1, 210, Obj)
    	p1=p1-ps
    end
    if I2==1 then
    	screen:blit(p2, 170, Obj)
    	p2=p2-ps
    end
    if I2==2 then
    	screen:blit(p2, 210, Obj)
    	p2=p2-ps
    end
    if I3==1 then
    	screen:blit(p3, 170, Obj)
    	p3=p3-ps
    end
    if I3==2 then
    	screen:blit(p3, 210, Obj)
    	p3=p3-ps
    end
    if I4==1 then
    	screen:blit(p4, 170, Obj)
    	p4=p4-ps
    end
    if I4==2 then
    	screen:blit(p4, 210, Obj)
    	p4=p4-ps
    end
    the red one is line 120

    also it gives me the error for every part of the pole images part exept the first 2 "if" statments
    Geändert von soadnation (03-04-2006 um 07:08 PM Uhr)

  5. #575
    QJ Gamer Bronze
    Points: 5.975, Level: 50
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Alabama
    Beiträge
    272
    Points
    5.975
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    to kingofnoobs....well i got it somewhat working...its not perfect.fires one bullet at a time until it goes past the edge of the screen.
    sometimes i get an error, dunno if its related to this or not.
    also a problem while jumping. maybe this can get you started and give you a better idea than my sloppy makeshift code :P

    EDIT: i didnt set a starting direction for the kunai ( i used the variable kundir )
    so if you dont move first before firing, it stays stil lol

    heres the file
    Angehängte Dateien Angehängte Dateien
    Geändert von PSPMillionaire (03-04-2006 um 07:52 PM Uhr)
    My lua tutorials for PSP - www.evilmana.com/tutorials
    PSP Lua CodeBase - Add your own code examples to the codebase! - www.evilmana.com/tutorials/codebase/

  6. #576
    QJ Gamer Green
    Points: 40.380, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Grand Line
    Beiträge
    5.996
    Points
    40.380
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    thanks, and also if i wanted it to be like if you could have more then one weapons would i make it so that i press R and it will like somehow change from kunai to shuriken then exploding tag and etc? and also, how do you make a game menu?
    [CENTER][IMG]http://img130.imageshack.us/img130/1640/acefcbanner2wo9.gif[/IMG]
    [SIZE=1][B]I'm soo hot[/B][/SIZE]
    [/CENTER]
    [SIZE=2][CENTER][/SIZE][/CENTER]
    [center]Sorry. No Advertising[/center]

  7. #577
    QJ Gamer Bronze
    Points: 5.975, Level: 50
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Alabama
    Beiträge
    272
    Points
    5.975
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    you could change all the "kun" stuff i used like kunaix kunaiy kunstate etc.. to something like weaponx weapony etc... so that it would be global to all weapons
    You could make an array to store all your weapon images, and use types to store the left and right of each in there.. such as
    Code:
    weapons = {}
    weapons[1] = { l = Image.load(blah), r = Image.load(blah) }
    weapons[2] = { l = Image.load(blah), r = Image.load(blah) }
    You could then refer to them with weapons[1].l and weapons[1].r etc...

    then do the code for when you press r . for this you could make a variable that counts up by 1 each time you press r. when it gets to the last weapon number you would need to make code to make it restart at 1. you would need to use the "oldpad" in this so that it wouldnt change weapons a million times a second.

    the drawing code would look something like...

    Code:
    if pad:circle() and oldpad ~= oldpad:circle() and weaponfire == false then
    weaponx = screenx
    weapony = screeny
    weaponfire = true
    weapondir = lastdir
    if lastdir == "left" then 
    weaponstate = weapons[counterVariable].l
    elseif lastdir == "right" then
    weaponstate = weapons[counterVariable].r		
    end
    end
    Maybe you can understand what Im saying here lol. I would go into it more but I gotta get to bed in a bit for work. up at 5 am again
    Geändert von PSPMillionaire (03-04-2006 um 08:29 PM Uhr)
    My lua tutorials for PSP - www.evilmana.com/tutorials
    PSP Lua CodeBase - Add your own code examples to the codebase! - www.evilmana.com/tutorials/codebase/

  8. #578
    QJ Gamer Green
    Points: 40.380, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    Grand Line
    Beiträge
    5.996
    Points
    40.380
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    hmmm this looks a little hard, but thanks though ill look into it :)
    [CENTER][IMG]http://img130.imageshack.us/img130/1640/acefcbanner2wo9.gif[/IMG]
    [SIZE=1][B]I'm soo hot[/B][/SIZE]
    [/CENTER]
    [SIZE=2][CENTER][/SIZE][/CENTER]
    [center]Sorry. No Advertising[/center]

  9. #579
    QJ Gamer Bronze
    Points: 5.975, Level: 50
    Level completed: 13%, Points required for next Level: 175
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Alabama
    Beiträge
    272
    Points
    5.975
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    I'll help tomorrow. Send me a message if you want in case I forget.
    Look at my tutorial on Tables ( Arrays) and you'll understand the above a bit more maybe.
    Nite!
    My lua tutorials for PSP - www.evilmana.com/tutorials
    PSP Lua CodeBase - Add your own code examples to the codebase! - www.evilmana.com/tutorials/codebase/

  10. #580
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Anyone any ideas with my problem?

    Can someone tell me how to/if its REALLY hard to make an analog stick cursor move and click?

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

    @Soadnation:
    I don't know whats wrong with your code soadnation. But i still think tables are the way to go. If you still want to do it this way, then i need more of your code. I don't get all the variables.

    @Glynnder
    It's not that hard to make a analog cursor. The clicking is a little harder. You have to check if it's on top of something. Then if you press some button, it has to do something. The checking if it's on top of something is the hardest part.
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  12. #582
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    i was having some trouble with the tables so i decided to fiish it and then learn to do tables(im hoping to remake more minigames from the fusion frenzy game). anyways hers my code. its kind of messy though

    Code:
    Background = Image.load("background.png")
    PlayerStand = Image.load("Playerstand.png")
    PlayerJump = Image.load("Playerjump.png")
    PlayerDuck = Image.load("playerduck.png")
    Obj = Image.load("Obj.png")
    green = Color.new(0, 255, 0)
    XAxis = 100
    YAxis =178
    --Pole Variables--
    ps=1 --How fast they move
    rc=1 --Ready to create
    p1=480 --X cordinats
    P2=480
    P3=480
    P4=480
    x2=480
    x3=480
    x4=480
    I1=0
    I2=0
    I3=0
    I4=0
    NP=0 --Number of Poles
    ct=0 --Creation Timer
    
    
    --Jump/Duck   Variables
    at=1 --Air Time
    aj=0 --Active Jump
    rj=0 --Ready to Jump
    as=0 --Animation Status
    ad=0 --Active Duck
    rd=0 --Ready to Duck
    dt=1 --Duck Time
    while true do
    
    --X Place(for when you get hit)
    Place=100
    
    screen:clear()
    pad = Controls.read()
    screen:blit(0, 0, Background,  false)
    if pad:left() then
      XAxis = XAxis-1
    end
    
    if pad:right() then
      XAxis = XAxis+1
    end
    
    if pad:start() then
      break
    end
    
    -- Jump Script--
    
    if aj==0 and ad==0 and math.abs(YAxis) > 177 then if XAxis>Place then XAxis=XAxis-(ps-0.3) end rj=1 else rj=0 end
    if pad:circle() and rj==1 then aj=1 as=1 end
    if aj==1 and math.abs(at) < 30 then YAxis=YAxis-4 at=at+1 XAxis=XAxis+1 end
    if at==30 then aj=0 at=1  end
    if aj==0 and math.abs(YAxis) < 178 then YAxis=YAxis+5 as=0 end
    -- Jump Script End --
    
    --Duck Script--
    if aj==0 and ad==0 then rd=1 else rd=0 end
    if pad:cross() and rd==1 then ad=1 as=2 end
    if ad==1 then dt=dt+1 end
    if dt==45 then ad=0 dt=1 end
    if ad==0 then as=0 end
    --Duck Script End--
    
    --Jump Animation
    if as==0 then
    screen:blit(XAxis, YAxis, PlayerStand)
    end
    if as==1 then
    screen:blit(XAxis, YAxis, PlayerJump)
    end
    if as==2 then
    screen:blit(XAxis, YAxis, PlayerDuck)
    end
    --Jump Animation End
    
    PVars = {480,480,480,480}
    
    --Pole Creation
    if rc==1 then
    	if NP==0 then
      	if math.random(0, 1)==0 then I1=1 NP=1 rc=0 else I1=2 NP=1 rc=0 end
    	end
    	if NP==1 then
    	if math.random(0, 1)==0 then I2=1 NP=2 rc=0 else I2=2 NP=2 rc=0 end
    	end
    	if NP==2 then
    	if math.random(0, 1)==0 then I3=1 NP=3 rc=0 else I3=2 NP=3 rc=0 end
    	end
    	if NP==3 then
    	if math.random(0, 1)==0 then I4=1 NP=4 rc=0 else I4=2 NP=4 rc=0 end
    	end
    end
    
    --Pole Timer
    if rc==0 then ct=ct+ps end
    if ct==12 then ct=0 rc=1 end
    	
    --Pole images
    
    if I1==1 then
    	p1=p1-ps
    	screen:blit(p1, 170, Obj)
    end
    if I1==2 then
    	screen:blit(p1, 210, Obj)
    	p1=p1-ps
    end
    if I2==1 then
    	screen:blit(p2, 170, Obj)
    	p2=p2-ps
    end
    if I2==2 then
    	screen:blit(p2, 210, Obj)
    	p2=p2-ps
    end
    if I3==1 then
    	screen:blit(p3, 170, Obj)
    	p3=p3-ps
    end
    if I3==2 then
    	screen:blit(p3, 210, Obj)
    	p3=p3-ps
    end
    if I4==1 then
    	screen:blit(p4, 170, Obj)
    	p4=p4-ps
    end
    if I4==2 then
    	screen:blit(p4, 210, Obj)
    	p4=p4-ps
    end
    
    
    screen.waitVblankStart()
    screen.flip()
    end

  13. #583
    QJ Gamer Blue
    Points: 5.036, Level: 45
    Level completed: 44%, Points required for next Level: 114
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    224
    Points
    5.036
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    Is this possible with LUA and how would I go about doing it?

    if *something happens* then
    *load up new lua script*

    like start a fresh script and forget about everything from the last one..

  14. #584
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    yes it is. use thios code

    dofile ("your file.lua")

    if it is inside another directory use this code first

    System.currentDirectory(" youir folder name")

  15. #585
    QJ Gamer Blue
    Points: 5.036, Level: 45
    Level completed: 44%, Points required for next Level: 114
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    224
    Points
    5.036
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    Thanks, that's great!

  16. #586
    is not posting very often
    Points: 33.152, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 99,6%

    Registriert seit
    Feb 2006
    Ort
    omnipresent
    Beiträge
    5.162
    Points
    33.152
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    OK, can someone help me with the cde, I'll post what i have, but what i can't get to happen is the cursor to be displayed, so maybe someone could post the code and I'll just use the bit i need

  17. #587
    QJ Gamer Blue
    Points: 5.036, Level: 45
    Level completed: 44%, Points required for next Level: 114
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    224
    Points
    5.036
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    time = 0

    How would I make time go up by 1 every second?

  18. #588
    11th Squad Captain
    Points: 26.490, Level: 97
    Level completed: 14%, Points required for next Level: 860
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    You are here -----> 名前: アダム | 飲むコー&#1
    Beiträge
    2.562
    Points
    26.490
    Level
    97
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von lui2603
    time = 0

    How would I make time go up by 1 every second?
    You can find the timer under this post
    (As an attachement )
    i made it fast and pretty simple ..
    Anyway i hope you like it :icon_razz ..
    Angehängte Dateien Angehängte Dateien
    FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

    開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
    Currently Working On: - Flashmod V2.50 - Flashmod V2.60
    Currently Drinking: Coffee! - 私はコーヒーを飲む
    Chao Garden: DEMO v0.6
    Chao Garden V0.5b Review!

  19. #589
    SHOOP DA WHOOP
    Points: 12.310, Level: 72
    Level completed: 65%, Points required for next Level: 140
    Overall activity: 99,7%

    Registriert seit
    Aug 2005
    Ort
    Wii forums
    Beiträge
    7.407
    Points
    12.310
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    how do i create a menu?

  20. #590
    11th Squad Captain
    Points: 26.490, Level: 97
    Level completed: 14%, Points required for next Level: 860
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    You are here -----> 名前: アダム | 飲むコー&#1
    Beiträge
    2.562
    Points
    26.490
    Level
    97
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von mannymix03
    how do i create a menu?
    Menus are easy .
    This is an example :icon_razz ..
    You could easily make a different menu :)
    Code:
    screen:clear()
    green = Color.new(0, 255, 0)
    color = Color.new(255, 255, 255)
    menustatus=0
    
    while true do
    --set menu option
    --Select Options
    pad = Controls.read()
    if pad:down() then
    	menustatus = menustatus + 1
    screen.waitVblankStart(10)
    end
    if pad:up() then
    	menustatus = menustatus - 1
    screen.waitVblankStart(10)
    end
    
    if pad:cross() and
    	menustatus == 0 then
    		System.currentDirectory("mylua")
    		dofile("index.lua")
    	end
    	if menustatus == 2 and pad:cross() then
    		break
    	end
    --Make Menu
    if menustatus == 0 then
    	screen:print(160, 100, "Play", color)
    	screen:print(160, 120, "Info", green)
    	screen:print(160, 140, "Exit", green)
    	screen.flip()
    end
    
    if menustatus == 1 then
    	screen:print(160, 100, "Play", green)
    	screen:print(160, 120, "Info", color)
    	screen:print(160, 140, "Exit", green)
    	screen.flip()
    end
    
    if menustatus == 2 then
    	screen:print(160, 100, "Play", green)
    	screen:print(160, 120, "Info", green)
    	screen:print(160, 140, "Exit", color)
    	screen.flip()
    end
    if menustatus == -1 then
    menustatus = menustatus +3
    end
    if menustatus == 3 then
    menustatus = menustatus -3
    end
    end
    FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

    開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
    Currently Working On: - Flashmod V2.50 - Flashmod V2.60
    Currently Drinking: Coffee! - 私はコーヒーを飲む
    Chao Garden: DEMO v0.6
    Chao Garden V0.5b Review!

  21. #591
    Tha Sigerator
    Points: 26.703, Level: 97
    Level completed: 36%, Points required for next Level: 647
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    New Orleans, LA
    Beiträge
    4.047
    Points
    26.703
    Level
    97
    Downloads
    0
    Uploads
    0

    Standard

    woah! that menu iz kick arse. hehe

    i'm such a n00b at this.
    where can i find snipplets?
    - - - - Somewhere Lurking in THA SHADOWS - - - -

    Check Out My Myspace HERE
    Comment My Qj Wiki

  22. #592
    11th Squad Captain
    Points: 26.490, Level: 97
    Level completed: 14%, Points required for next Level: 860
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    You are here -----> 名前: アダム | 飲むコー&#1
    Beiträge
    2.562
    Points
    26.490
    Level
    97
    Downloads
    0
    Uploads
    0

    Standard

    Snippets?
    Try Googling this :icon_razz ...
    May sound stupid but it always works for me.
    Or i visit ps2dev.org sometimes and they have
    some good snippets (or the official lua psp site)
    FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

    開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
    Currently Working On: - Flashmod V2.50 - Flashmod V2.60
    Currently Drinking: Coffee! - 私はコーヒーを飲む
    Chao Garden: DEMO v0.6
    Chao Garden V0.5b Review!

  23. #593
    Tha Sigerator
    Points: 26.703, Level: 97
    Level completed: 36%, Points required for next Level: 647
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    New Orleans, LA
    Beiträge
    4.047
    Points
    26.703
    Level
    97
    Downloads
    0
    Uploads
    0

    Standard

    o.k thx

    i think vandens gonn release that maze prog.
    - - - - Somewhere Lurking in THA SHADOWS - - - -

    Check Out My Myspace HERE
    Comment My Qj Wiki

  24. #594
    11th Squad Captain
    Points: 26.490, Level: 97
    Level completed: 14%, Points required for next Level: 860
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    You are here -----> 名前: アダム | 飲むコー&#1
    Beiträge
    2.562
    Points
    26.490
    Level
    97
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von xodiac21
    o.k thx

    i think vandens gonn release that maze prog.
    This site might be what your
    looking for http://wiki.ps2dev.org/psp:lua_player:functions
    I hope that helps , it sure is handy!
    (And lua is open source which means C+ YAY! lol)
    FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

    開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
    Currently Working On: - Flashmod V2.50 - Flashmod V2.60
    Currently Drinking: Coffee! - 私はコーヒーを飲む
    Chao Garden: DEMO v0.6
    Chao Garden V0.5b Review!

  25. #595
    Tha Sigerator
    Points: 26.703, Level: 97
    Level completed: 36%, Points required for next Level: 647
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    New Orleans, LA
    Beiträge
    4.047
    Points
    26.703
    Level
    97
    Downloads
    0
    Uploads
    0

    Standard

    Hey. this isn't much...i don't think...but uhh. check it out

    Code:
    green = Color.new(0,255,0)
    
    Lpicture = Image.load("c2.png")
    Rpicture = Image.load("c1.png")
    Uppic = Image.load("b1.png")
    Downpic = Image.load("b4.png")
    Leftpic = Image.load("b2.png")
    Rightpic = Image.load("b3.png")
    r1 = Image.load("a1.png")
    r2 = Image.load("a4.png")
    r3 = Image.load("a2.png")
    r4 = Image.load("a3.png")
    
    upPressed = 'You are pressing the "UP" button'
    downPressed = 'You are pressing the "DOWN" button'
    leftPressed = 'You are pressing the "LEFT" button'
    rightPressed = 'You are pressing the "RIGHT" button'
    LPressed = 'You are pressing the "L" button'
    
    screen:print(3, 0, "HI!", green)
    screen.flip()
    
    screen.waitVblankStart(120  )
    
    screen:clear()
    screen:print(3, 0, "I'm Xodiac21", green)
    screen.flip()
    
    screen.waitVblankStart(120  )
    
    screen:clear()
    screen:print(3, 0, "n00b Programmer", green)
    screen.flip()
    
    screen.waitVblankStart(120  )
    
    screen:clear()
    screen:print(3, 0, "NO, this isn't jus a text prog.", green)
    screen.flip()
    
    screen.waitVblankStart(120  )
    
    screen:clear()
    screen:print(3, 0, "I learned button imput :-D", green)
    screen.flip()
    
    screen.waitVblankStart(120  )
    
    screen:clear()
    screen:print(3, 0, "All 10 buttons are now active!", green)
    screen.flip()
    
    screen.waitVblankStart(120  )
    
    screen:clear()
    screen:print(3, 0, "try it out", green)
    screen.flip()
    
    screen.waitVblankStart(120  )
    
    while true do
    
    screen:clear()
    
    pad = Controls.read()
    
    if pad:up() then
    screen:blit(0,0,Uppic)
    end
    if pad:down() then
    screen:blit(0,0,Downpic)
    end
    if pad:left() then
    screen:blit(0,0,Leftpic)
    end
    if pad:right() then
    screen:blit(0,0,Rightpic)
    end
    if pad:l() then
    screen:blit(0,0,Lpicture)
    end
    if pad:r() then
    screen:blit(0,0,Rpicture)
    end
    if pad:triangle() then
    screen:blit(0,0,r1)
    end
    if pad:circle() then
    screen:blit(0,0,r2)
    end
    if pad:cross() then
    screen:blit(0,0,r3)
    end
    if pad:square() then
    screen:blit(0,0,r4)
    end
    
    screen.waitVblankStart()
    screen.flip()
    end
    Angehängte Dateien Angehängte Dateien
    - - - - Somewhere Lurking in THA SHADOWS - - - -

    Check Out My Myspace HERE
    Comment My Qj Wiki

  26. #596
    QJ Gamer Blue
    Points: 5.036, Level: 45
    Level completed: 44%, Points required for next Level: 114
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    224
    Points
    5.036
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von c5cha7
    You can find the timer under this post
    (As an attachement )
    i made it fast and pretty simple ..
    Anyway i hope you like it :icon_razz ..
    Thanks c5cha7, didn't notice that under this thread sorry..

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

    @Soadnation:
    Damn that took me a while. I know your problem: You have two different variables. On top you use "P2" and later on you use "p2". See the difference? Capital letter and a normal letter. You do the same with "p3" and "p4". All you have to do is change those. Lol, that was a really small error. Good luck with it!

    Altair
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

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

    @Glynnder- PSPro
    First read about blitting images. It's exactly the same. And don't forget to blit the cursor as the last thing you blit. Otherwise it will blit another image on top of the cursor.

    Altair
    LUA manual:
    [url]http://www.lua.org/manual/5.0/manual.html[/url]

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

  29. #599
    QJ Gamer Blue
    Points: 5.631, Level: 48
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Beiträge
    375
    Points
    5.631
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    nt beleive i didnt see it. thanls

  30. #600
    QJ Gamer Blue
    Points: 5.036, Level: 45
    Level completed: 44%, Points required for next Level: 114
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    224
    Points
    5.036
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    I need some help with making my character jump...
    at the moment I've got:

    jump = 0

    function jumpup()
    jump = jump + 1
    if jump>=1 and jump<=10 then
    spritey = spritey - 3
    spritedisplay = sprite[9]
    elseif jump>=11 and jump<=20 then
    spritey = spritey + 3
    spritedisplay = sprite[1]
    end
    if jump>=20 then
    jump = 0
    end
    end

    pad = Controls.read()
    if pad:cross() then
    jumpup()
    end


    It works ok but sometimes if I let go of X while my sprite is in the air it just hovers rather than falling... how would I make the sprite go up and back down with 1 tap of the X button rather than having to hold it in? thanks..

    EDIT: Wow.. that code looks complicated... and to think it was only 2 days ago that I didn't even know how to make the screen display an image
    Geändert von lui2603 (03-07-2006 um 03:30 PM Uhr)


 

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 .