Do you like my tutorials?

Then consider supporting me on Ko-fi

Talking about Circle Chain game, Game development and iOS.

While Circle Chain is still waiting to score its 1000-th download in the App Store (download it! Remember I will give away the source code once I reach 1,000 downloads), I continue with my experiment of porting the game with various development tools.

Some days ago I showed you a basic prototype coded with lua using Corona SDK, and now I am showing you another lua-driven prototype, this time made with Giderios Studio.

Giderios Studio is a complete environment for mobile application and game development. Using Giderios Studio you can write your code, manage your assets, preview your assets and see the console output of your application using an integrated IDE.

I am finding this tool very intuitive and interesting, mainly thanks to its built-in code editor which is really useful since there aren’t that much lua syntax highlighters.

While I will make a complete review of the software later, this time I am showing you the code needed to create the same prototype I made with Corona SDK

application:setOrientation(Application.LANDSCAPE_LEFT)

local background = Bitmap.new(Texture.new("background.png"))
stage:addChild(background)
local container = Sprite.new()
stage:addChild(container)

for i=1,10 do 
		local greenCircle = Bitmap.new(Texture.new("greencircle.png"))
		local randomDirection = math.rad(math.random(0,359))
		container:addChild(greenCircle)
		greenCircle:setX(math.random(0,479))
		greenCircle:setY(math.random(0,319))
		greenCircle.xSpeed = 2*math.cos(randomDirection)
		greenCircle.ySpeed = 2*math.sin(randomDirection)
end

function onEnterFrame(event)
		for i=1,container:getNumChildren() do
			local currentCircle=container:getChildAt(i)
			currentCircle:setX(currentCircle:getX()+currentCircle.xSpeed);
			currentCircle:setY(currentCircle:getY()+currentCircle.ySpeed);
			if currentCircle:getX()<0 then
					currentCircle:setX(currentCircle:getX()+480)
			end
			if currentCircle:getX()>480 then
					currentCircle:setX(currentCircle:getX()-480)
			end
			if currentCircle:getY()<0 then
					currentCircle:setY(currentCircle:getY()+320)
			end
			if currentCircle:getY()>320 then
					currentCircle:setY(currentCircle:getY()-320)
			end
		end
end

stage:addEventListener(Event.ENTER_FRAME, onEnterFrame)

I recommend to have a look at this official tutorial to set up your first application, and then test the code I am giving you.

I am also giving you the complete project folder to download.

Never miss an update! Subscribe, and I will bother you by email only when a new game or full source code comes out.