Programming Fundamentals  
General Course Information  
Edirlei Soares de Lima  
Programming Fundamentals  
Professor: Edirlei Soares de Lima  
B.Sc. in Computer Science UnC  
M.Sc. in Computer Science UFSM  
Ph.D. in Computer Science PUC-Rio  
Teaching Experience: PUC-Rio, UNIRIO, UERJ, IADE-UE  
Game Experience:  
Game Engines: RPG Builder, 3D Game Builder;  
Research Projects: most are related with Logtell (;  
Games: Krimson (Best Game Award at SBGames 2010 Indie Game Development  
Festival), and several other prototype games.  
More Information:  
Programming Fundamentals  
What is computer programming?  
The process of writing, testing and maintaining a computer program  
for accomplishing a specific task.  
What is a computer program?  
A sequence of instructions that automate the process of performing a  
task for solving a specific problem.  
How to write a computer program?  
A computer program is written using a programming language.  
Programming Fundamentals  
What is a programming language?  
A programming language is a vocabulary and set of grammatical rules  
for instructing a computer to perform specific tasks.  
Examples of programming languages: C, C++, C#, Java, JavaScript,  
HTML, PHP, Python, Lua, Processing, Ruby, Objective-C, Prolog, Go, …  
What is the best programming language?  
There is no "best programming language". It depends on the goals of  
the application, platform, programmer’s skills, etc.  
Programming Fundamentals  
Games Development:  
Study the fundamentals of computer programming in a game  
development context.  
Learning Outcomes:  
. Understand the concepts of algorithm and program  
. Construct algorithms to solve specific problems  
. Implement simple graphical and interactive applications  
. Apply the concepts learned in the development of small-size  
computer games  
Programming Fundamentals  
Module Content:  
. Introduction to programming: concepts of algorithm and program  
. Introduction to Lua: variables, data types, operators and functions  
. Introduction to computer graphics: coordinates, color, transparency,  
and Löve 2D  
. Conditional statements and user interaction  
. Loops and images  
. Vectors, physics and collision detection  
. Arrays, matrices, animations and level representations  
. Music and audio effects  
Project-Based Learning:  
Learn by doing;  
"Large" project;  
Active and experiential learning:  
Theoretical concepts;  
Practical examples;  
Implementation exercises;  
Programming Language: Lua  
Continuous Assessment:  
[20%] Individual exercises on the concepts learned;  
[25%] Practical exam on the concepts learned;  
[10%] Mini-Project with Math, Physics, and Games I;  
[20%] Game prototype (2nd delivery of the semester’s PBL project);  
[25%] Final game (final delivery of the semester’s PBL project).  
Final Assessment:  
[100%] Practical exam on the concepts learned.  
Project deliveries:  
1st delivery: game specification  
No evaluation for Programming Fundamentals  
2nd delivery: working prototype  
General code organization and indentation, appropriate use of variables,  
well-structured loops, appropriate use of arrays, functions and correct  
physics simulation  
3rd delivery: final version  
Same as the 2nd delivery + overall code complexity and game experience  
+ individual discussion + programming report  
Lua Programming Language  
Lua is a powerful, fast, lightweight, embeddable,  
free and open-source scripting language designed  
for general purposes.  
In video game development, Lua is one of the most  
popular scripting language for game programming.  
Lua was developed by a team of researchers at  
PUC-Rio (Pontifical Catholic University of Rio de  
Janeiro) in Brazil.  
Currently, PUC-Rio has an entire laboratory (LabLua)  
dedicated for the development and maintenance of the  
Lua language.  
Lua Programming Language  
Games that use Lua as scripting language:  
Angry Birds  
Civilization V  
Far Cry  
Grim Fandango  
Dota 2  
World of Warcraft  
Löve 2D Framework  
LÖVE is a framework to create 2D games in Lua.  
It comprises a library of functions to draw visual objects, control user  
interaction, simulate physics, play audio, and everything else a game  
It's free, open-source and multiplatform (Windows, Linux, Mac OS,  
Android, iOS, Web Browsers).  
Löve 2D 11.4:
Visual Studio Code:  
Löve 2D extension:  
Example of Game (Lua + Löve2D)  
function love.draw()  
for i = 1, numStars do - stars[i].speed,  
55 - stars[i].speed/2,  
50, stars[i].speed*0.9), stars[i].x,  
stars[i].y, 0, stars[i].speed/255 + 0.55)  
end, 255, 255)  
if spaceship_isBoosted == false then,  
spaceship_x, spaceship_y)  
spaceship_x, spaceship_y)  
local totalLaserBeams = table.getn(lasers)  
for i = 1, totalLaserBeams do, lasers[i].x,  
Ierusalimschy, R. (2016). Programming in Lua,  
Fourth Edition. Lua.Org. ISBN: 978-8590379867  
Ierusalimschy, R., Figueiredo, L. H., Celes, W.  
Media Limited. ISBN: 978-9888381227  
2015). Lua 5.2 Reference Manual. Samurai  
Christer, E. (2004). Real-Time Collision  
Detection. CRC Pres. ISBN: 978-1558607323  
Web Resources  
Lua 5.3 Reference Manual:  
Löve Documentation:  
Programming Fundamentals  
Canvas (Programming Fundamentals):  
Course Webpage: