Eufloria > Eufloria HD Mods

iPad Custom Level [HELP, Very Beginner]

<< < (4/9) > >>

Pilchard123:
That's because he missed out a few lines at the start. Ignore the first three lines of Aino's code.

Tomfloria:
Thanks Pilchard, but now I have the problem of the camera being able to move off screen.


--- Code: --- zoomRestricted  = true
cameraRestricted  = true
while GameRunning() do
if GetCameraZoom() > 3500 and GetCameraPosition() = (0,0) and zoomRestricted and cameraRestricted then
SetCameraPositionNow(0,0)
SetCameraZoomNow(3500)
end
--- End code ---

See this is the annoying thing for a beginner.

Pilchard123:
I see the problem. You will only lock the camera if it is zoomed out, and will only lock the zoom if the camera has not moved. Change the code to check each thing individually, like this


--- Code: ---zoomRestricted  = true
cameraRestricted  = true

while GameRunning() do
if GetCameraZoom() > 3500 and zoomRestricted then
SetCameraPositionNow(0,0)
SetCameraZoomNow(3500)
end
                if not GetCameraPosition() = (0,0) and cameraRestricted then
SetCameraPositionNow(0,0)
SetCameraZoomNow(3500)
end

                coroutine.yield()
end

--- End code ---

That NOT will basically check if the camera has moved - if it is NOT at (0,0). Sorry that's such a quick explanation, if you need more help just ask.

Tomfloria:
I will be needling a lot of help, but thank you for replying, I will add this and get back to you :)

I have this for function LevelLogic() but it crashes my game still :/

--- Code: ---
function LevelLogic()
StartLevelLogic()

zoomRestricted  = true
cameraRestricted  = true

while GameRunning() do
if GetCameraZoom() > 3500 and zoomRestricted then
SetCameraPositionNow(0,0)
SetCameraZoomNow(3500)
end

if not GetCameraPosition() = (0,0) and cameraRestricted then
SetCameraPositionNow(0,0)
SetCameraZoomNow(3500)
end

                coroutine.yield()

end
end
--- End code ---

Pilchard123:
Oh, one thing that I will ask - could you post any error messages that come up when you test a level?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version