Showing posts with label Lua. Show all posts
Showing posts with label Lua. Show all posts
Tuesday, 17 June 2014
What I miss in Python Game Development
As I said before (and I repeated), if I start a new project, I prefer to work with Python, 'cause I like its huge standard library, its portability and its syntax and this is true for every new project I do for work: such as "building netcdf files", "analize meteorological datas", "manage databases". But I had a big problem for a personal project, a long dreamed chimera never really realized: a videogame. I thought to build a simple shooter, something like the old "galaga" or "space impact", using hardware accelerated graphics for great effects, such as particles and flashes. There are many schools of thought on game development under Python: there's PyGame ones, Pyglet, Pandas, ecc. I would like to talk with you about actual game development in python and reflect about my needs
Sunday, 6 January 2013
Lua vs Python or Embedding vs Extending
Another (in)famous comparison!
At least once in your programmer career, you will face the need to add a scripting language to your program. Many famous programs use a scripting language: Unreal, Quake, Emacs, Blender 3D and many games.
But, when you decide it and when you start to project your implementation, you face a terrible dilemma: should you make a program with a interpreter or functions for a interpreter?
This crossroad is the "embed vs extend". I'll talk about my personal opinion and how this dilemma is equal by Lua vs Python comparison.
Etichette:
culture,
Lua,
Programming,
Python,
rants,
Software Design
Wednesday, 16 February 2011
No classes and objects in Lua. So...
So let's use old-C structs :D
How?
Image a struct to define a 2d point. It will looks like
struct Point2DStruct{ double x; double y; }; typedef struct Point2DStruct Point2D; Point2D* new_Point2D(double x, double y){ Point2D* result; result=(Point2D*)malloc(sizeof(Point2D)); result->x=x; result->y=y; return result; }
How we can do something similiar in Lua? With a table!
function new_Point2D(newx,newy) result={x=newx,y=newy}; return result; end
Easy, fast, and good looking. Well, you can also implement objects and classes using metatables. But I prefer using this "structured" way, because it's easier to read a to write.
Subscribe to:
Posts (Atom)