Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Start of a game engine (complete with Lua scripts)
Index -> Programming, C++ -> C++ Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
CodeMonkey2000




PostPosted: Sun Feb 01, 2009 6:46 pm   Post subject: 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 Very Happy). I will return to 3D once I am done this engine, and after I learn to use blender.

EDIT: Here are the dlls.



engineDLLs.rar
 Description:

Download
 Filename:  engineDLLs.rar
 Filesize:  666.23 KB
 Downloaded:  411 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
CodeMonkey2000




PostPosted: Sun Feb 01, 2009 11:09 pm   Post subject: 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.
Lua:
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




PostPosted: Mon Feb 02, 2009 1:36 am   Post subject: Re: Start of a game engine (complete with Lua scripts)

neat, i didn't even know such thing existed Shocked
CodeMonkey2000




PostPosted: Mon Feb 02, 2009 2:31 pm   Post subject: 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




PostPosted: Mon Feb 02, 2009 3:07 pm   Post subject: RE:Start of a game engine (complete with Lua scripts)

I envy your class.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: