Sorry also for the lack of without post anything, and also I re-re-work again on re-doing the code of my Inv. Menu and cheats menu stuff. :D
I reduced to 400 lines from about aprox. 1300 lines


there is an example about where I am now :P
Also I just show the necessary stuff in the code ( it's possible I missed some lines but you get the point

I want to have a table look like but I know it can't work like this, but if anyone have an idea :D
The Code I want to do
Code: Select all
-- 1= Mushroom, 2= FireFlowers, 3= Leaf, 4= IceFlowers, 5= Tanookie, 6= SledgeHammer ...
ItemsInvRow1 = { 1,2,3,4,5,6 }
ItemsInvRow2 = { 1,3,1,4,1,4 }
-- Can up to five Row Stock
The code I have now
Code: Select all
[...]
ItemsSelSpritesPosX = {0, 5, 10, 15, 20, 25.3}
ItemsSelSpritesPosY = {-3, 0, -4, 0, 0, -3}
local UnItems1 = UnSelMushroom
local UnItems2 = UnSelflower
local UnItems3 = UnSeltanookie
local UnItems4 = UnSelleafsmb3
local UnItems5 = UnSelIceflower
local UnItems6 = UnSelHammer
local SelItems1 = SelMushroom
local SelItems2 = Selflower
local SelItems3 = Seltanookie
local SelItems4 = Selleafsmb3
local SelItems5 = SelIceflower
local SelItems6 = SelHammer
local PowerUpsSelSprites = {
SelItems1 ;
SelItems2 ;
SelItems3 ;
SelItems4 ;
SelItems5 ;
SelItems6
}
local PowerUpsUnSelSprites = {
UnItems1 ;
UnItems2 ;
UnItems3 ;
UnItems4 ;
UnItems5 ;
UnItems6
}
local powerupsitemsstock = {
PLAYER_BIG ;
PLAYER_FIREFLOWER ;
PLAYER_ICE ;
PLAYER_LEAF ;
PLAYER_TANOOKIE ;
PLAYER_SMALL ;
PLAYER_HAMMER
}
function DebugMenuTest_API.onInitAPI()
registerEvent(DebugMenuTest_API, "onLoop", "onLoopOverride");
registerEvent(DebugMenuTest_API, "onLoad", "onLoadOverride");
registerEvent(DebugMenuTest_API, "onInputUpdate", "onInputUpdateOverride");
end
function DebugMenuTest_API.onLoopOverride()
[...]
local TimerA = math.floor(PosItemsX)
for k,v in pairs (PowerUpsUnSelSprites) do
for i=1, GetLinePUpsUnSelSprites do
Graphics.unplaceSprites( PowerUpsUnSelSprites[k])
Graphics.placeSprite(1, PowerUpsUnSelSprites[k] , 190 + 15 * ItemsSelSpritesPosX[k] , 535 + 1 * ItemsSelSpritesPosY[k]);
Graphics.unplaceSprites(PowerUpsSelSprites[TimerA])
Graphics.placeSprite(1, PowerUpsSelSprites[TimerA], 190 + 15 * ItemsSelSpritesPosX[TimerA] , 535 + 1 * ItemsSelSpritesPosY[TimerA]);
end
