All pastes #466869 Raw Edit

Something

public text v1 · immutable
·published 2007-05-02 04:31 UTC
rendered paste body
include( "modules/text.lua" )			--	Needed for rendering text on the screen.
include( "modules/logging.lua" )		--	Needed for writing stuff to the log file.

local ballX	= 0		--	Ball's X location.
local NorP	= 1		--	Negative or positive 1. Indicates balls direction.
local Width	= 200	--	Screen width.

function Initialize( )
	
	Logging.writeToLog( "LUA Side Initilization", 0, false )
	--	GUIManager.ShowMessageBox( "LOLOLOOL" )
	
end

function Render( deltaTime )

	if ( ballX <= Width and NorP == 1 ) then
		ballX = ballX + NorP * deltaTime
	end

	if ( ballX >= Width and NorP == 1 ) then
		NorP = -1
		ballX = ballX + NorP * deltaTime
	end

	if ( ballX <= Width and NorP == -1 ) then
		ballX = ballX + NorP * deltaTime
	end

	if ( ballX <= 0 and NorP == -1 ) then
		ballX = 0
		NorP = 1
	end
	
	Text.renderText( "|", 0, 50, 0, 255, 0 )
	Text.renderText( "o", ballX, 50, 0, 255, 0 )
	Text.renderText( "|", Width, 50, 0, 255, 0 )
	
end