Posted 15 March 2016 - 05:40 AM
I recently made a post called SimpleCCRockets, it's a game where you build and fly spaceships.
My problem is, when you build the rocket, it builds the rocket from the very top, going down, which is good, but when you fly, I want the spaceship you built on the bottom of the screen. And for the love of me I cannot get an algorithm that does it correctly. For now i'm stuck with the spaceship being at the top.
Pastebin: FG2KZuRf
Go to the drawRocket() function. That's where the problem is. At the Y part of the paintutils.drawImage is what needs to be tweaked.
Current function code:
//Off topic
I'm gonna bet that Bomb Bloke is going to respond first.
Nope,
My problem is, when you build the rocket, it builds the rocket from the very top, going down, which is good, but when you fly, I want the spaceship you built on the bottom of the screen. And for the love of me I cannot get an algorithm that does it correctly. For now i'm stuck with the spaceship being at the top.
Pastebin: FG2KZuRf
Go to the drawRocket() function. That's where the problem is. At the Y part of the paintutils.drawImage is what needs to be tweaked.
Current function code:
local function drawRocket()
nextPos = 1
totalHeight = 0
for i=1,#rocketDesign do
totalHeight = totalHeight + #rocketDesign
end
for i=1,#rocketDesign do
if(rocketDesign[i] == engineOff or rocketDesign[i] == engineOn) then
paintutils.drawImage(rocketDesign[i],w/2-1,nextPos)
else
paintutils.drawImage(rocketDesign[i],w/2,nextPos)
end
end
end
//Off topic
Nope,
Edited on 15 March 2016 - 05:50 AM