Articles in the General game programming Category
AS3, General game programming, flash, managers »
First of all, to understand the need of a centralized manager for filters in flash, we need to understand how filters are set on a DisplayObject.
To set a filter, we first need to create a BitmapFilter object :
// create a new blur filter
var blur:BlurFilter = new BlurFilter(4.0, 4.0, 1);
Then add it to the “filters” property (which is an array) of a DisplayObject like so:
// get a copy of the "filters" array
var aFilters:Array = displayObject.filters;
// add our filter to our new array
aFilters.push(blur);
// and set our new array
displayObject.filters = aFilters;
Why do we …
AS3, General game programming, managers »
What for ?
Events centralization allows to listen for events of an object that we don’t have direct access to.
Example
We have a button in a MovieClip that is not directly connected to your main MovieClip or class where you want to keep all the events logic. There are many ways to get the reference of your button but if you only need to listen for its events then there is a simple way.
Events centralization
The core of the centralization system is a Singleton (some sort of …
AS3, Game, General game programming, Math, Useful links »
There are many ways to calculate the surface of a polygon. It all depends on what kind of data you have to deal with. If you have only vertices (points) or if you have the segments associated to them as well.
The most evident solution would be to divide the polygon in triangles and calculate the surface of them. But this can quickly become complicated as you will have to test every segment of every triangle and check if they are intersecting with a current polygon’s segment or if it goes …
AS3, Game, General game programming, Network programming, Strange/Bugs, managers »
Basic Events manager classes. Remove all events, group events, suspend and resume events…
Features
Keep track of all events added and removed with this manager.
Add listener.
Remove listener.
Add a listener to one or more groups.
Suspsend a listener and/or a group of listeners without removing them.
Resume a listener and/or a group of listeners.
Remove all listeners from a group.
Remove all listeners.
For what purpose ?
Well, frankly, those events are sometimes a pain in the arse to manage.
Let’s say we have a bunch of buttons we just want to disable for some period of time and then …
AS3, Game, General game programming »
Let’s have a look at arrays vs. linked lists, and for what use.
Here, the assumption is that we need to access a property and/or call a function from a lot of objects in a list at the highest speed possible. Let’s say we are making a game and we want to go through all of our animated sprite objects.
Basically, we have two options:
Arrays
Linked lists
Arrays
Commonly used, arrays are easy to manipulate. You just need to iterate through it and access each object via its index in the list. For a loop …
General game programming, Visual Basic »
TexturEd is a GUI for the vTex utility used in the 3D Source Engine from Valve.
This tool was specifically made for games such as Half-life 2 and its mods and Counter-Strike Source.
TexturEd simplifies the creation of textures’s materials. Everything is managed (compilation options, materials, customs variables, shaders and their fallbacks, proxies).
All shaders, fallbacks, proxies, material properties and compilating options are loaded from .txt files allowing you to update it easily.
The development has been stopped, no more time, source code is here for you free to use.
(A french version of this …
General game programming, Network programming, Visual Basic »
Sources d’un projet de jeu d’échec en ligne.
L’interface a été réalisée en Flash, Visual Basic servant ici de couche gérant la partie réseau.
Le programme permet de se connecter à un serveur de type “chessanytime” et d’y jouer. La partie intéressante se trouvant dans les codes prenant en charge la gestion des commandes échangées avec le serveur.
Les serveurs “chessanytime” ne sont désormais plus entièrement gratuits. Il est toujours possible d’y jouer en tant que “guest”.
Télécharger la source : .
General game programming, Visual Basic »
Textured est un GUI (General User Interface, une interface) pour vTex, l’utilitaire servant à créer des matériaux pour le moteur de jeux Source Engine.
Il est complet mais vieux et possède encore qques bugs (ne dérangent pas lors d’une utilisation normale).
Il permet d’éditer les options de compilations et les propriétés des matériaux (shaders, fallbacks, proxies, …)
Toutes les données sont chargées à partir de fichiers .txt donc Textured peut facilement être utilisé pour des mods.
Il n’a pas été testé avec la nouvelle version du moteur.
Le zip contient les sources commentées du programme …





