
-----------------------------------
CodeMonkey2000
Sun Feb 01, 2009 6:46 pm

Start of a game engine (complete with Lua scripts)
-----------------------------------
I this is a start of a 2D game engine, with embedded scripting (with Lua). I'm taking a break from 3D programming to learn how to use blender, photoshop and make scripts. I used luna as my C++ wrapper. This is actually pretty fun. It feels like I am writing my own language. You can edit the script in main.lua and just run the exe (no need to compile :D). I will return to 3D once I am done this engine, and after I learn to use blender.

EDIT: Here are the dlls.

-----------------------------------
CodeMonkey2000
Sun Feb 01, 2009 11:09 pm

Re: Start of a game engine (complete with Lua scripts)
-----------------------------------
Here is a fractal tree. I just rewrote an old turing post, but I can't find it. This is almost like programming in turing lol. Just save it over main.lua, and rerun the exe.
setScreen(860, 500,false,"Fractal Tree")

DEG_TO_RAD=57.29578
function fractal (x,y,ang,len,n,ang2)
	if n>8 then
		tmp=colour(255*0.3,255*0.3,0)
	else
		tmp=colour(0,100,0)
	end
	drawLine(x,500-y,math.floor(math.cos (ang/DEG_TO_RAD)*len+x),500-math.floor( math.sin (ang/DEG_TO_RAD)*len+y),tmp)
	if(n>0) then
		fractal(math.cos (ang/DEG_TO_RAD)*len+x, math.sin (ang/DEG_TO_RAD)*len+y, ang + ang2,len-3, n - 1, ang2)
		fractal(math.cos (ang/DEG_TO_RAD)*len+x, math.sin (ang/DEG_TO_RAD)*len+y, ang - ang2, len-3, n - 1, ang2)
	end
end
while not done do
	cls(BLACK)
	mx,my,r,l=getMouseState()
	fractal (860/2,0, 90, 50, 13,my/20)
	update()
	done=tryQuit()
end
endP()

-----------------------------------
Homer_simpson
Mon Feb 02, 2009 1:36 am

Re: Start of a game engine (complete with Lua scripts)
-----------------------------------
neat, i didn't even know such thing existed  :shock:

-----------------------------------
CodeMonkey2000
Mon Feb 02, 2009 2:31 pm

RE:Start of a game engine (complete with Lua scripts)
-----------------------------------
Lol, my CS teacher recommended that I learn it. He is very knowledgeable, unlike most high school CS teachers.

-----------------------------------
Insectoid
Mon Feb 02, 2009 3:07 pm

RE:Start of a game engine (complete with Lua scripts)
-----------------------------------
I envy your class.
