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 Grimfate126 put this: Code: math.randomseed(os.time()) at the VERY top of your code. itll work. i did and it ...
-
05-06-2006, 08:06 AM #2071QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
i did and it doesnt work
Zitat von Grimfate126
-
05-06-2006, 08:07 AM #2072Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Zitat von montrob
did it give you an error?--------------------------------------------------------------------------------------
-
05-06-2006, 08:09 AM #2073QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
nope..
Zitat von Grimfate126
heres what happens.. every time i start the program i get a diff. random number.. but it stays like that for the whole game
-
05-06-2006, 08:09 AM #2074TheMarioKartersGuest
That's what your code is supposed to do.
Zitat von montrob
-
05-06-2006, 08:11 AM #2075Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Zitat von montrob
umm.. thats kinda the point...
p.s. dam, TMK beat me to it.--------------------------------------------------------------------------------------
-
05-06-2006, 08:12 AM #2076QJ Gamer Silver
- Registriert seit
- Jun 2005
- Ort
- The Migrant Fleet
- Beiträge
- 908
- Points
- 9.678
- Level
- 66
- Downloads
- 0
- Uploads
- 0
umm well could you read my post on the previous page..
Zitat von TheMarioKarters
-
05-06-2006, 08:13 AM #2077TheMarioKartersGuest
I did...the code you posted does exactly what it's supposed to do.
Zitat von montrob
-
05-06-2006, 08:15 AM #2078
I have a probleme:
but how do i make so that when i press X again it will doCode:if pad:cross() and Command == 1 then Select:play() Drawcard = 1 end if Drawcard == 1 then drawCard() Points = Points+Pointstwo end
drawCardthree() Points = Points+Pointstwo+Pointsth ree
and not
drawCard() Points = Points+PointstwoGeändert von ZereoX (05-06-2006 um 08:20 AM Uhr)
-
05-06-2006, 08:17 AM #2079Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Zitat von ZereoX
i dunt get a word ur saying... next time u post code, put it in the code tags, its much easieer to read.--------------------------------------------------------------------------------------
-
05-06-2006, 08:18 AM #2080TheMarioKartersGuest
Next time post it like this.
Zitat von ZereoX
-
05-06-2006, 08:19 AM #2081Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Zitat von TheMarioKarters
NOW i get it.
try this:
Code:if pad:cross() then Points = Points + Pointstwo + Pointsthree drawCardthree() end
--------------------------------------------------------------------------------------
-
05-06-2006, 08:45 AM #2082QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
include a second variable with
Zitat von ZereoX
Code:if Drawcard == 1 then drawCard() end
have the second variable keep changing everytime you press X.Code:if Drawcard == 1 and variable == 1 then drawCard() end
Code:if pad:cross() and Command == 1 then Select:play() Drawcard = 1 variable = variable + 1 end
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-06-2006, 08:59 AM #2083
i got it working but here is the problem
When you start the game the first card appears then when you press hit the second and the third for lke 5 milliesecond appears but when you press hit again you have to hold the x so that the third card stay's there.Code:if pad:cross() and Command == 1 then Select:play() Drawcard = 1 end if Drawcard == 1 then drawCard() Points = Points + Pointstwo Drawcardthree = 1 end if pad:cross() and Command == 1 and Drawcardthree == 1 then Select:play() Drawcardthree = 2 end if Drawcardthree == 2 then drawCardthree() Points = Points+Pointsthree end
What can i do so it wont's dissapear when i let go XGeändert von ZereoX (05-06-2006 um 09:12 AM Uhr)
-
05-06-2006, 09:29 AM #2084QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
another variable.
Zitat von ZereoX
lol[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-06-2006, 09:42 AM #2085
what do you mean other variable LOL
??
Example plz.
-
05-06-2006, 09:43 AM #2086QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
i need to see the part of your code where the actual blitting takes place.
Zitat von ZereoX
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-06-2006, 09:46 AM #2087
Do you want me to give it all to you by msn or just post all my code.
-
05-06-2006, 09:47 AM #2088QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
post it.
Zitat von ZereoX
i dont use instant messengers.
a nasty virus came in from msn, so i dont use it anymore.[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-06-2006, 09:48 AM #2089
Code:-- FF IX Black Jack -- Author:Zereo_X -- Color Defenition red = Color.new(255,0,0) blue = Color.new(0,255,0) green = Color.new(0,0,255) white = Color.new(255,255,255) -- Image Load/Sound/Music/ Table = Image.load("images/Table.png") PauseMenu = Image.load("images/Gamepaused.png") GameOver = Image.load("images/GameOver.png") Title = Image.load("images/TitleScreen.png") Selector = Image.load("images/Selector.png") Select = Sound.load("sounds/Select.wav",false) --Drawcardfunction function drawCard() if W == 1 then screen:blit(55, 165, Aceclover) elseif W == 2 then screen:blit(55, 165, Acediamond) elseif W == 3 then screen:blit(55, 165, Aceheart) elseif W == 4 then screen:blit(55, 165, Acespade) elseif W == 5 then screen:blit(55, 165, Twoclover) elseif W == 6 then screen:blit(55, 165, Twodiamond) elseif W == 7 then screen:blit(55, 165, Twoheart) elseif W == 8 then screen:blit(55, 165, Twospade) elseif W == 9 then screen:blit(55, 165, Threeclover) elseif W == 10 then screen:blit(55, 165, Threediamond) elseif W == 11 then screen:blit(55, 165, Threeheart) elseif W == 12 then screen:blit(55, 165, Threespade) elseif W == 13 then screen:blit(55, 165, Fourclover) elseif W == 14 then screen:blit(55, 165, Fourdiamond) elseif W == 15 then screen:blit(55, 165, Fourheart) elseif W == 16 then screen:blit(55, 165, Fourspade) elseif W == 17 then screen:blit(55, 165, Fiveclover) elseif W == 18 then screen:blit(55, 165, Fivediamond) elseif W == 19 then screen:blit(55, 165, Fiveheart) elseif W == 20 then screen:blit(55, 165, Fivespade) elseif W == 21 then screen:blit(55, 165, Sixclover) elseif W == 22 then screen:blit(55, 165, Sixdiamond) elseif W == 23 then screen:blit(55, 165, Sixheart) elseif W == 24 then screen:blit(55, 165, Sixspade) elseif W == 25 then screen:blit(55, 165, Sevenclover) elseif W == 26 then screen:blit(55, 165, Sevendiamond) elseif W == 27 then screen:blit(55, 165, Sevenheart) elseif W == 28 then screen:blit(55, 165, Sevenspade) elseif W == 29 then screen:blit(55, 165, eightclover) elseif W == 30 then screen:blit(55, 165, eightdiamond) elseif W == 31 then screen:blit(55, 165, eightheart) elseif W == 32 then screen:blit(55, 165, eightspade) elseif W == 33 then screen:blit(55, 165, Nineclover) elseif W == 34 then screen:blit(55, 165, Ninediamond) elseif W == 35 then screen:blit(55, 165, Nineheart) elseif W == 36 then screen:blit(55, 165, Ninespade) elseif W == 37 then screen:blit(55, 165, Tenclover) elseif W == 38 then screen:blit(55, 165, Tendiamond) elseif W == 39 then screen:blit(55, 165, Tenheart) elseif W == 40 then screen:blit(55, 165, Tenspade) elseif W == 41 then screen:blit(55, 165, Jackclover) elseif W == 42 then screen:blit(55, 165, Jackdiamond) elseif W == 43 then screen:blit(55, 165, Jackheart) elseif W == 44 then screen:blit(55, 165, Jackspade) elseif W == 45 then screen:blit(55, 165, Queenclover) elseif W == 46 then screen:blit(55, 165, Queendiamond) elseif W == 47 then screen:blit(55, 165, Queenheart) elseif W == 48 then screen:blit(55, 165, Queenspade) elseif W == 49 then screen:blit(55, 165, Kingclover) elseif W == 50 then screen:blit(55, 165, Kingdiamond) elseif W == 51 then screen:blit(55, 165, Kingheart) elseif W == 52 then screen:blit(55, 165, Kingspade) end end function drawCardthree() if V == 1 then screen:blit(70, 165, Aceclover) elseif V == 2 then screen:blit(70, 165, Acediamond) elseif V == 3 then screen:blit(70, 165, Aceheart) elseif V == 4 then screen:blit(70, 165, Acespade) elseif V == 5 then screen:blit(70, 165, Twoclover) elseif V == 6 then screen:blit(70, 165, Twodiamond) elseif V == 7 then screen:blit(70, 165, Twoheart) elseif V == 8 then screen:blit(70, 165, Twospade) elseif V == 9 then screen:blit(70, 165, Threeclover) elseif V == 10 then screen:blit(70, 165, Threediamond) elseif V == 11 then screen:blit(70, 165, Threeheart) elseif V == 12 then screen:blit(70, 165, Threespade) elseif V == 13 then screen:blit(70, 165, Fourclover) elseif V == 14 then screen:blit(70, 165, Fourdiamond) elseif V == 15 then screen:blit(70, 165, Fourheart) elseif V == 16 then screen:blit(70, 165, Fourspade) elseif V == 17 then screen:blit(70, 165, Fiveclover) elseif V == 18 then screen:blit(70, 165, Fivediamond) elseif V == 19 then screen:blit(70, 165, Fiveheart) elseif V == 20 then screen:blit(70, 165, Fivespade) elseif V == 21 then screen:blit(70, 165, Sixclover) elseif V == 22 then screen:blit(70, 165, Sixdiamond) elseif V == 23 then screen:blit(70, 165, Sixheart) elseif V == 24 then screen:blit(70, 165, Sixspade) elseif V == 25 then screen:blit(70, 165, Sevenclover) elseif V == 26 then screen:blit(70, 165, Sevendiamond) elseif V == 27 then screen:blit(70, 165, Sevenheart) elseif V == 28 then screen:blit(70, 165, Sevenspade) elseif V == 29 then screen:blit(70, 165, eightclover) elseif V == 30 then screen:blit(70, 165, eightdiamond) elseif V == 31 then screen:blit(70, 165, eightheart) elseif V == 32 then screen:blit(70, 165, eightspade) elseif V == 33 then screen:blit(70, 165, Nineclover) elseif V == 34 then screen:blit(70, 165, Ninediamond) elseif V == 35 then screen:blit(70, 165, Nineheart) elseif V == 36 then screen:blit(70, 165, Ninespade) elseif V == 37 then screen:blit(70, 165, Tenclover) elseif V == 38 then screen:blit(70, 165, Tendiamond) elseif V == 39 then screen:blit(70, 165, Tenheart) elseif V == 40 then screen:blit(70, 165, Tenspade) elseif V == 41 then screen:blit(70, 165, Jackclover) elseif V == 42 then screen:blit(70, 165, Jackdiamond) elseif V == 43 then screen:blit(70, 165, Jackheart) elseif V == 44 then screen:blit(70, 165, Jackspade) elseif V == 45 then screen:blit(70, 165, Queenclover) elseif V == 46 then screen:blit(70, 165, Queendiamond) elseif V == 47 then screen:blit(70, 165, Queenheart) elseif V == 48 then screen:blit(70, 165, Queenspade) elseif V == 49 then screen:blit(70, 165, Kingclover) elseif V == 50 then screen:blit(70, 165, Kingdiamond) elseif V == 51 then screen:blit(70, 165, Kingheart) elseif V == 52 then screen:blit(70, 165, Kingspade) end end --Funtion Command = 0 math.randomseed(os.time() ) V = math.random(1,52) W = math.random(1,52) Z = math.random(1,52) X = math.random(1,52) Y = math.random(1,52) Points = 0 Pointstwo = 0 Pointsthree = 0 Dealerpoints = 0 Drawcard = 0 Drawcardthree = 0 --Cards/Load Aceclover = Image.load("cards/AceClover.png") Acediamond = Image.load("cards/AceDiamond.png") Aceheart = Image.load("cards/Aceheart.png") Acespade = Image.load("cards/AceSpade.png") Twoclover = Image.load("cards/2Clover.png") Twodiamond = Image.load("cards/2Diamond.png") Twoheart = Image.load("cards/2Heart.png") Twospade = Image.load("cards/2Spade.png") Threeclover = Image.load("cards/3Clover.png") Threediamond = Image.load("cards/3Diamond.png") Threeheart = Image.load("cards/3Heart.png") threeSpade = Image.load("cards/3Spade.png") Fourclover = Image.load("cards/4Clover.png") Fourdiamond = Image.load("cards/4Diamond.png") Fourheart = Image.load("cards/4Heart.png") Fourspade = Image.load("cards/4Spade.png") Fiveclover = Image.load("cards/5Clover.png") Fivediamond = Image.load("cards/5Diamond.png") Fiveheart = Image.load("cards/5Heart.png") Fivespade = Image.load("cards/5Spade.png") Sixclover = Image.load("cards/6Clover.png") Sixdiamond = Image.load("cards/6Diamond.png") Sixheart = Image.load("cards/6Heart.png") Sixspade = Image.load("cards/6Spade.png") Sevenclover = Image.load("cards/7Clover.png") Sevendiamond = Image.load("cards/7Diamond.png") Sevenheart = Image.load("cards/7Heart.png") Sevenspade = Image.load("cards/7Spade.png") eightclover = Image.load("cards/8Clover.png") eightdiamond = Image.load("cards/8Diamond.png") eightheart = Image.load("cards/8heart.png") eightspade = Image.load("cards/8Spade.png") Nineclover = Image.load("cards/9Clover.png") Ninediamond = Image.load("cards/9Diamond.png") Nineheart = Image.load("cards/9Heart.png") Ninespade = Image.load("cards/9Spade.png") Tenclover = Image.load("cards/10Clover.png") Tendiamond = Image.load("cards/10Diamond.png") Tenheart = Image.load("cards/10Heart.png") Tenspade = Image.load("cards/10Spade.png") Jackclover = Image.load("cards/JackClover.png") Jackdiamond = Image.load("cards/JackDiamond.png") Jackheart = Image.load("cards/JackHeart.png") Jackspade = Image.load("cards/JackSpade.png") Queenclover = Image.load("cards/QueenClover.png") Queendiamond = Image.load("cards/QueenDiamond.png") Queenheart = Image.load("cards/QueenHeart.png") Queenspade = Image.load("cards/QueenSpade.png") Kingclover = Image.load("cards/QueenClover.png") Kingdiamond = Image.load("cards/KingDiamond.png") Kingheart = Image.load("cards/KingHeart.png") Kingspade = Image.load("cards/KingSpade.png") --Text while true do pad = Controls.read() screen:blit(0,0,Table) if X == 1 then screen:blit(40, 165, Aceclover) elseif X == 2 then screen:blit(40, 165, Acediamond) elseif X == 3 then screen:blit(40, 165, Aceheart) elseif X == 4 then screen:blit(40, 165, Acespade) elseif X == 5 then screen:blit(40, 165, Twoclover) elseif X == 6 then screen:blit(40, 165, Twodiamond) elseif X == 7 then screen:blit(40, 165, Twoheart) elseif X == 8 then screen:blit(40, 165, Twospade) elseif X == 9 then screen:blit(40, 165, Threeclover) elseif X == 10 then screen:blit(40, 165, Threediamond) elseif X == 11 then screen:blit(40, 165, Threeheart) elseif X == 12 then screen:blit(40, 165, Threespade) elseif X == 13 then screen:blit(40, 165, Fourclover) elseif X == 14 then screen:blit(40, 165, Fourdiamond) elseif X == 15 then screen:blit(40, 165, Fourheart) elseif X == 16 then screen:blit(40, 165, Fourspade) elseif X == 17 then screen:blit(40, 165, Fiveclover) elseif X == 18 then screen:blit(40, 165, Fivediamond) elseif X == 19 then screen:blit(40, 165, Fiveheart) elseif X == 20 then screen:blit(40, 165, Fivespade) elseif X == 21 then screen:blit(40, 165, Sixclover) elseif X == 22 then screen:blit(40, 165, Sixdiamond) elseif X == 23 then screen:blit(40, 165, Sixheart) elseif X == 24 then screen:blit(40, 165, Sixspade) elseif X == 25 then screen:blit(40, 165, Sevenclover) elseif X == 26 then screen:blit(40, 165, Sevendiamond) elseif X == 27 then screen:blit(40, 165, Sevenheart) elseif X == 28 then screen:blit(40, 165, Sevenspade) elseif X == 29 then screen:blit(40, 165, eightclover) elseif X == 30 then screen:blit(40, 165, eightdiamond) elseif X == 31 then screen:blit(40, 165, eightheart) elseif X == 32 then screen:blit(40, 165, eightspade) elseif X == 33 then screen:blit(40, 165, Nineclover) elseif X == 34 then screen:blit(40, 165, Ninediamond) elseif X == 35 then screen:blit(40, 165, Nineheart) elseif X == 36 then screen:blit(40, 165, Ninespade) elseif X == 37 then screen:blit(40, 165, Tenclover) elseif X == 38 then screen:blit(40, 165, Tendiamond) elseif X == 39 then screen:blit(40, 165, Tenheart) elseif X == 40 then screen:blit(40, 165, Tenspade) elseif X == 41 then screen:blit(40, 165, Jackclover) elseif X == 42 then screen:blit(40, 165, Jackdiamond) elseif X == 43 then screen:blit(40, 165, Jackheart) elseif X == 44 then screen:blit(40, 165, Jackspade) elseif X == 45 then screen:blit(40, 165, Queenclover) elseif X == 46 then screen:blit(40, 165, Queendiamond) elseif X == 47 then screen:blit(40, 165, Queenheart) elseif X == 48 then screen:blit(40, 165, Queenspade) elseif X == 49 then screen:blit(40, 165, Kingclover) elseif X == 50 then screen:blit(40, 165, Kingdiamond) elseif X == 51 then screen:blit(40, 165, Kingheart) elseif X == 52 then screen:blit(40, 165, Kingspade) end if Y == 1 then screen:blit(40, 30, Aceclover) elseif Y == 2 then screen:blit(40, 30, Acediamond) elseif Y == 3 then screen:blit(40, 30, Aceheart) elseif Y == 4 then screen:blit(40, 30, Acespade) elseif Y == 5 then screen:blit(40, 30, Twoclover) elseif Y == 6 then screen:blit(40, 30, Twodiamond) elseif Y == 7 then screen:blit(40, 30, Twoheart) elseif Y == 8 then screen:blit(40, 30, Twospade) elseif Y == 9 then screen:blit(40, 30, Threeclover) elseif Y == 10 then screen:blit(40, 30, Threediamond) elseif Y == 11 then screen:blit(40, 30, Threeheart) elseif Y == 12 then screen:blit(40, 30, Threespade) elseif Y == 13 then screen:blit(40, 30, Fourclover) elseif Y == 14 then screen:blit(40, 30, Fourdiamond) elseif Y == 15 then screen:blit(40, 30, Fourheart) elseif Y == 16 then screen:blit(40, 30, Fourspade) elseif Y == 17 then screen:blit(40, 30, Fiveclover) elseif Y == 18 then screen:blit(40, 30, Fivediamond) elseif Y == 19 then screen:blit(40, 30, Fiveheart) elseif Y == 20 then screen:blit(40, 30, Fivespade) elseif Y == 21 then screen:blit(40, 30, Sixclover) elseif Y == 22 then screen:blit(40, 30, Sixdiamond) elseif Y == 23 then screen:blit(40, 30, Sixheart) elseif Y == 24 then screen:blit(40, 30, Sixspade) elseif Y == 25 then screen:blit(40, 30, Sevenclover) elseif Y == 26 then screen:blit(40, 30, Sevendiamond) elseif Y == 27 then screen:blit(40, 30, Sevenheart) elseif Y == 28 then screen:blit(40, 30, Sevenspade) elseif Y == 29 then screen:blit(40, 30, eightclover) elseif Y == 30 then screen:blit(40, 30, eightdiamond) elseif Y == 31 then screen:blit(40, 30, eightheart) elseif Y == 32 then screen:blit(40, 30, eightspade) elseif Y == 33 then screen:blit(40, 30, Nineclover) elseif Y == 34 then screen:blit(40, 30, Ninediamond) elseif Y == 35 then screen:blit(40, 30, Nineheart) elseif Y == 36 then screen:blit(40, 30, Ninespade) elseif Y == 37 then screen:blit(40, 30, Tenclover) elseif Y == 38 then screen:blit(40, 30, Tendiamond) elseif Y == 39 then screen:blit(40, 30, Tenheart) elseif Y == 40 then screen:blit(40, 30, Tenspade) elseif Y == 41 then screen:blit(40, 30, Jackclover) elseif Y == 42 then screen:blit(40, 30, Jackdiamond) elseif Y == 43 then screen:blit(40, 30, Jackheart) elseif Y == 44 then screen:blit(40, 30, Jackspade) elseif Y == 45 then screen:blit(40, 30, Queenclover) elseif Y == 46 then screen:blit(40, 30, Queendiamond) elseif Y == 47 then screen:blit(40, 30, Queenheart) elseif Y == 48 then screen:blit(40, 30, Queenspade) elseif Y == 49 then screen:blit(40, 30, Kingclover) elseif Y == 50 then screen:blit(40, 30, Kingdiamond) elseif Y == 51 then screen:blit(40, 30, Kingheart) elseif Y == 52 then screen:blit(40, 30, Kingspade) end if X == 1 then Points = 1 elseif X == 2 then Points = 1 elseif X == 3 then Points = 1 elseif X == 4 then Points = 1 elseif X == 5 then Points = 2 elseif X == 6 then Points = 2 elseif X == 7 then Points = 2 elseif X == 8 then Points = 2 elseif X == 9 then Points = 3 elseif X == 10 then Points = 3 elseif X == 11 then Points = 3 elseif X == 12 then Points = 3 elseif X == 13 then Points = 4 elseif X == 14 then Points = 4 elseif X == 15 then Points = 4 elseif X == 16 then Points = 4 elseif X == 17 then Points = 5 elseif X == 18 then Points = 5 elseif X == 19 then Points = 5 elseif X == 20 then Points = 5 elseif X == 21 then Points = 6 elseif X == 22 then Points = 6 elseif X == 23 then Points = 6 elseif X == 24 then Points = 6 elseif X == 25 then Points = 7 elseif X == 26 then Points = 7 elseif X == 27 then Points = 7 elseif X == 28 then Points = 7 elseif X == 29 then Points = 8 elseif X == 30 then Points = 8 elseif X == 31 then Points = 8 elseif X == 32 then Points = 8 elseif X == 33 then Points = 9 elseif X == 34 then Points = 9 elseif X == 35 then Points = 9 elseif X == 36 then Points = 9 elseif X == 37 then Points = 10 elseif X == 38 then Points = 10 elseif X == 39 then Points = 10 elseif X == 40 then Points = 10 elseif X == 41 then Points = 10 elseif X == 42 then Points = 10 elseif X == 43 then Points = 10 elseif X == 44 then Points = 10 elseif X == 45 then Points = 10 elseif X == 46 then Points = 10 elseif X == 47 then Points = 10 elseif X == 48 then Points = 10 elseif X == 49 then Points = 10 elseif X == 50 then Points = 10 elseif X == 51 then Points = 10 elseif X == 52 then Points = 10 end if X == 1 then Dealerpoints = 1 elseif Y == 2 then Dealerpoints = 1 elseif Y == 3 then Dealerpoints = 1 elseif Y == 4 then Dealerpoints = 1 elseif Y == 5 then Dealerpoints = 2 elseif Y == 6 then Dealerpoints = 2 elseif Y == 7 then Dealerpoints = 2 elseif Y == 8 then Dealerpoints = 2 elseif Y == 9 then Dealerpoints = 3 elseif Y == 10 then Dealerpoints = 3 elseif Y == 11 then Dealerpoints = 3 elseif Y == 12 then Dealerpoints = 3 elseif Y == 13 then Dealerpoints = 4 elseif Y == 14 then Dealerpoints = 4 elseif Y == 15 then Dealerpoints = 4 elseif Y == 16 then Dealerpoints = 4 elseif Y == 17 then Dealerpoints = 5 elseif Y == 18 then Dealerpoints = 5 elseif Y == 19 then Dealerpoints = 5 elseif Y == 20 then Dealerpoints = 5 elseif Y == 21 then Dealerpoints = 6 elseif Y == 22 then Dealerpoints = 6 elseif Y == 23 then Dealerpoints = 6 elseif Y == 24 then Dealerpoints = 6 elseif Y == 25 then Dealerpoints = 7 elseif Y == 26 then Dealerpoints = 7 elseif Y == 27 then Dealerpoints = 7 elseif Y == 28 then Dealerpoints = 7 elseif Y == 29 then Dealerpoints = 8 elseif Y == 30 then Dealerpoints = 8 elseif Y == 31 then Dealerpoints = 8 elseif Y == 32 then Dealerpoints = 8 elseif Y == 33 then Dealerpoints = 9 elseif Y == 34 then Dealerpoints = 9 elseif Y == 35 then Dealerpoints = 9 elseif Y == 36 then Dealerpoints = 9 elseif Y == 37 then Dealerpoints = 10 elseif Y == 38 then Dealerpoints = 10 elseif Y == 39 then Dealerpoints = 10 elseif Y == 40 then Dealerpoints = 10 elseif Y == 41 then Dealerpoints = 10 elseif Y == 42 then Dealerpoints = 10 elseif Y == 43 then Dealerpoints = 10 elseif Y == 44 then Dealerpoints = 10 elseif Y == 45 then Dealerpoints = 10 elseif Y == 46 then Dealerpoints = 10 elseif Y == 47 then Dealerpoints = 10 elseif Y == 48 then Dealerpoints = 10 elseif Y == 49 then Dealerpoints = 10 elseif Y == 50 then Dealerpoints = 10 elseif Y == 51 then Dealerpoints = 10 elseif Y == 52 then Dealerpoints = 10 end if W == 1 then Pointstwo = 1 elseif W == 2 then Pointstwo = 1 elseif W == 3 then Pointstwo = 1 elseif W == 4 then Pointstwo = 1 elseif W == 5 then Pointstwo = 2 elseif W == 6 then Pointstwo = 2 elseif W == 7 then Pointstwo = 2 elseif W == 8 then Pointstwo = 2 elseif W == 9 then Pointstwo = 3 elseif W == 10 then Pointstwo = 3 elseif W == 11 then Pointstwo = 3 elseif W == 12 then Pointstwo = 3 elseif W == 13 then Pointstwo = 4 elseif W == 14 then Pointstwo = 4 elseif W == 15 then Pointstwo = 4 elseif W == 16 then Pointstwo = 4 elseif W == 17 then Pointstwo = 5 elseif W == 18 then Pointstwo = 5 elseif W == 19 then Pointstwo = 5 elseif W == 20 then Pointstwo = 5 elseif W == 21 then Pointstwo = 6 elseif W == 22 then Pointstwo = 6 elseif W == 23 then Pointstwo = 6 elseif W == 24 then Pointstwo = 6 elseif W == 25 then Pointstwo = 7 elseif W == 26 then Pointstwo = 7 elseif W == 27 then Pointstwo = 7 elseif W == 28 then Pointstwo = 7 elseif W == 29 then Pointstwo = 8 elseif W == 30 then Pointstwo = 8 elseif W == 31 then Pointstwo = 8 elseif W == 32 then Pointstwo = 8 elseif W == 33 then Pointstwo = 9 elseif W == 34 then Pointstwo = 9 elseif W == 35 then Pointstwo = 9 elseif W == 36 then Pointstwo = 9 elseif W == 37 then Pointstwo = 10 elseif W == 38 then Pointstwo = 10 elseif W == 39 then Pointstwo = 10 elseif W == 40 then Pointstwo = 10 elseif W == 41 then Pointstwo = 10 elseif W == 42 then Pointstwo = 10 elseif W == 43 then Pointstwo = 10 elseif W == 44 then Pointstwo = 10 elseif W == 45 then Pointstwo = 10 elseif W == 46 then Pointstwo = 10 elseif W == 47 then Pointstwo = 10 elseif W == 48 then Pointstwo = 10 elseif W == 49 then Pointstwo = 10 elseif W == 50 then Pointstwo = 10 elseif W == 51 then Pointstwo = 10 elseif W == 52 then Pointstwo = 10 end if V == 1 then Pointsthree = 1 elseif V == 2 then Pointsthree = 1 elseif V == 3 then Pointsthree = 1 elseif V == 4 then Pointsthree = 1 elseif V == 5 then Pointsthree = 2 elseif V == 6 then Pointsthree = 2 elseif V == 7 then Pointsthree = 2 elseif V == 8 then Pointsthree = 2 elseif V == 9 then Pointsthree = 3 elseif V == 10 then Pointsthree = 3 elseif V == 11 then Pointsthree = 3 elseif V == 12 then Pointsthree = 3 elseif V == 13 then Pointsthree = 4 elseif V == 14 then Pointsthree = 4 elseif V == 15 then Pointsthree = 4 elseif V == 16 then Pointsthree = 4 elseif V == 17 then Pointsthree = 5 elseif V == 18 then Pointsthree = 5 elseif V == 19 then Pointsthree = 5 elseif V == 20 then Pointsthree = 5 elseif V == 21 then Pointsthree = 6 elseif V == 22 then Pointsthree = 6 elseif V == 23 then Pointsthree = 6 elseif V == 24 then Pointsthree = 6 elseif V == 25 then Pointsthree = 7 elseif V == 26 then Pointsthree = 7 elseif V == 27 then Pointsthree = 7 elseif V == 28 then Pointsthree = 7 elseif V == 29 then Pointsthree = 8 elseif V == 30 then Pointsthree = 8 elseif V == 31 then Pointsthree = 8 elseif V == 32 then Pointsthree = 8 elseif V == 33 then Pointsthree = 9 elseif V == 34 then Pointsthree = 9 elseif V == 35 then Pointsthree = 9 elseif V == 36 then Pointsthree = 9 elseif V == 37 then Pointsthree = 10 elseif V == 38 then Pointsthree = 10 elseif V == 39 then Pointsthree = 10 elseif V == 40 then Pointsthree = 10 elseif V == 41 then Pointsthree = 10 elseif V == 42 then Pointsthree = 10 elseif V == 43 then Pointsthree = 10 elseif V == 44 then Pointsthree = 10 elseif V == 45 then Pointsthree = 10 elseif V == 46 then Pointsthree = 10 elseif V == 47 then Pointsthree = 10 elseif V == 48 then Pointsthree = 10 elseif V == 49 then Pointsthree = 10 elseif V == 50 then Pointsthree = 10 elseif V == 51 then Pointsthree = 10 elseif V == 52 then Pointsthree = 10 end if pad:up() and oldpad:up() ~= pad:up() then Command = Command-1 end if pad:down() and oldpad:down() ~= pad:down() then Command = Command+1 end if Command > 3 then Command = 0 end if Command < 0 then Command = 3 end if Command == 0 then screen:blit(350,175,Selector) else if Command == 1 then screen:blit(360,195,Selector) else if Command == 2 then screen:blit(343,215,Selector) else if Command == 3 then screen:blit(350,235,Selector) end end end end if pad:cross() and Command == 0 then Select:play() end if pad:cross() and Command == 1 then Select:play() Drawcard = 1 end if Drawcard == 1 then drawCard() Points = Points + Pointstwo end Drawcardthree = 1 if pad:cross() and Command == 1 and Drawcardthree == 1 then Select:play() Drawcardthree = 2 end if Drawcardthree == 2 then drawCardthree() Points = Points+Pointsthree end if pad:cross() and Command == 2 then Select:play() end if pad:cross() and Command == 3 then Select:play() end battlvl = System.powerGetBatteryLifePercent() screen:print(107, 264, battlvl, white) screen:print(125, 264, "%", white) screen:print(5, 264, "BatteryPower:", white) screen:print(55, 20,"Dealer", white) screen:print(65, 155,"You", white) screen:print(13, 210,Points, white) screen:print(9, 200,"PTS", white) screen:print(13, 75,Dealerpoints, white) screen:print(9, 65,"PTS", white) screen.waitVblankStart() screen.flip() oldpad = pad end
-
05-06-2006, 09:50 AM #2090QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
Try this to see what happens.
Zitat von ZereoX
I changed the functions into variables.Geändert von EminentJonFrost (05-06-2006 um 10:05 AM Uhr)
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-06-2006, 10:00 AM #2091
Found anything except that i have to make it smaller
-
05-06-2006, 10:05 AM #2092
Hey , can someone tell me how i can do sinus/cosinus operations in lua pls? and an example would be great too
thanks
-
05-06-2006, 10:10 AM #2093QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
Last time I checked, they were called "Sine" and "Cosine".
Zitat von agashka
These are the commands you're looking for:
In the parantheses, you put the values you want for Luaplayer to solve.Code:math.cos() math.sin() math.tan()
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-06-2006, 10:13 AM #2094QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
ZereoX, check back a few posts.
I know that wont solve your problem, but its a different way to look at it.
The problem is: that the functions dont continue. they end right when you release 'X'. If they had a 'while true do' loop in them, the cards would stay, but the controls you put outside in the MAIN 'while true do' loop wont be in effect.[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
05-06-2006, 01:14 PM #2095
Eminent il just add the win and lose for now and make a release to show everyone max 2 cards so first acrd then hit then you have to stand.
-
05-06-2006, 01:56 PM #2096
- Registriert seit
- Apr 2006
- Beiträge
- 20
- Points
- 4.110
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Also, it's important to note that Lua takes input for Trig functions in RADIANS ONLY. So, if you want to supply a value in degrees, you'll also have to convert it to radians with math.rad(). Therefore, your code might look something like:
Zitat von EminentJonFrost
math.sin(math.rad(45))
-
05-06-2006, 03:04 PM #2097
When I press R, the first two lines under the if statement happen... the third one dosen't. Anyone know why and could help me?Code:if pad:r() and oldpad:r() ~= pad:r() then varPlayer = 2 enemyhealth = enemyhealth - VarPlayerrage * .1 varPlayerrage = 0 end
-
05-06-2006, 03:07 PM #2098QJ Gamer Gold
- Registriert seit
- Mar 2006
- Ort
- LOLWUT
- Beiträge
- 2.625
- Points
- 18.627
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Hold up, is the v in VarPlayerrage supposed to be in capital? beacuse the next one is not.
Zitat von Spiritbeast
-
05-06-2006, 04:32 PM #2099
Zitat von EminentJonFrost
Thanks alot EminentJonFrost , if your interested take a look at what this served to me here:
http://forums.qj.net/psp-development-forum/50097-gta2-port-psp.html#post624074
thanks!!!
-
05-06-2006, 04:35 PM #2100QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
already did! :)
Zitat von agashka
your welcome![CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]


LinkBack URL
About LinkBacks
Mit Zitat antworten
lay() Drawcard = 1

Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum