Accueil > > > CHIMERA GAMES ENGINE
CHIMERA GAMES ENGINE
Information sur la source
Description
Vue que code-sources n'accepte pas des fichier de taille plus grand que 1Mo j'ai mis a votre disposition WWW.CHIMERA2D.COM Le Site Contient en plus des code sources et executable du projet une documentation complete online et telechargable ansi que des tutorials et de sources Chimera est un moteur de création de jeux vidéo écrit en C#, qui combine Facilité et puissance. Le moteur utilise la librairie XNA qui permet une portabilité (Cross Plateform) entre PC et Xbox360. Ainsi, et avec la richesse que lui porte la POO, Chimera est l'outil dont vous avez besoin pour créer votre jeu vidéo 2D en toute maitrise et simplicité. Chimera 2D est un projet Open Source, ce qui vous offre un accès total au code. Avec son système InteliSense qui vous accompagne dans chaque étape et enrichie votre expérience en offrant des propositions et en proposant de l’aide, Chimera a été conçue pour être facilement maîtrisable par amateurs et professionnels. Le projet Chimera 2D est un projet très particulier pour nous, la team invite tout les développeurs du monde entier à y participer, nous seront open pour toutes suggestions, idées ou propositions.. Quelques Fonctionnalités de Chimera Games Engine 2D : * Moteur Audio : Prend en charge plus de 22 Format différents... * Moteur Physique : Inclue une gestion complète de la physique grâce à l'implémentation du moteur Farseer ainsi que la possibilité d'utiliser des classes propres à Chimera.... * Moteur Graphique : gestion complète des : Image, Sprite, Animation, Effects, BackGround... * Intégration du Moteur De Particule Complet : Mercury.... + Prise En Charge Du GUI : (Graphical User Interface) Window, Label, List, Combo, Text..... o Prise En Charge Des Entrées : Clavier, Souris, GamePad.... o Gestion de profil joueur : Sauvegarde/Chargement... o Gestion Des Scènes du jeu WWW.CHIMERA2D.COM
Source
- //WWW.CHIMERA2D.COM
- //Le Site Contient en plus des code sources et executable du projet une documentation complete online et telechargable ansi que des tutorials et de sources
- #region Info/Author
- //----------------------------------------------------------------------------
- // Author: Tazi Mehdi
- // Source: Chimera 2D GAMES ENGINE
- // Info: Image public class : Basic public class
- //-----------------------------------------------------------------------------
- #endregion
- #region Using Statement
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- #endregion
-
- namespace Chimera.Graphics
- {
- /// <summary>
- /// This Class Allow You To Use An Image
- /// </summary>
- public class Image : Helpers.Interface.IDrawable, Helpers.Interface.IDrawables
- {
- /// <summary>
- /// The Default Constructor
- /// </summary>
- public Image()
- {
- //SetOrigin(Chimera.Graphics.Enumeration.EImageOrigin.Center);
- }
- #region Fields(spriteBatch,texture,imgsource,origin,position,size,rotation,color,scale,effects,depth)
-
- private SpriteBatch spriteBatch;
-
- private Texture2D texture;//la texture contient une ou plusieur images
- protected Rectangle imgsource;//X,Y image a dessiner
- protected Vector2 origin; //origine de l'image par defaut : haut agauche
-
- private Vector2 position;
- private Vector2 size;
- private float rotation;
-
- private Color color;
- private Vector2 scale;
- private Vector2 strevect = Vector2.Zero;
- private bool stretch = false;
- private SpriteEffects effects;
- protected float depth;
-
- protected int totalColumns;
- protected int totalRows;
-
- #endregion
- #region Properties(Position,Size,Rotation,Color,Scale)
- /// <summary>
- /// Get Or Set The Image Position
- /// </summary>
- public Vector2 Position
- {
- get { return position; }
- set { position = value; }
- }
- /// <summary>
- /// Get Reference The SpriteBatch
- /// </summary>
- public SpriteBatch SpriteBatch
- {
- get { return this.spriteBatch; }
- }
- /// <summary>
- /// Get Or Set Image Size
- /// </summary>
- public Vector2 Size
- {
- get { return size; }
- set {
- size = value;
- strevect = new Vector2(size.X / texture.Width, size.Y / texture.Height);
- }
- }
- /// <summary>
- /// Get Reference to Texture2D
- /// </summary>
- public Texture2D Texture
- {
- get { return this.texture;}
- }
- /// <summary>
- /// Get Or Set The Origin Of Image
- /// </summary>
- public Vector2 Origin
- {
- get { return origin; }
- set { origin = value; }
- }
- /// <summary>
- /// Enable Or Disable The Stretch Mode
- /// </summary>
- public bool Stretch
- {
- get { return stretch;}
- set { stretch=value ;}
- }
- /// <summary>
- /// Get Or Set Rotation Degree
- /// </summary>
- public float Rotation
- {
- get { return rotation; }
- set { rotation = value; }
- }
-
- /// <summary>
- /// Get Or Set The Image Depth
- /// </summary>
- public float Depth
- {
- get { return depth; }
- set { depth = value; }
- }
-
- /// <summary>
- /// Get Or Set Image Color
- /// </summary>
- public Color Color
- {
- get { return color; }
- set { color = value; }
- }
-
- /// <summary>
- /// Get Or Set Image Scale Value
- /// </summary>
- public Vector2 Scale
- {
- get { return scale;}
- set { scale = value;}
- }
-
-
- /// <summary>
- /// Get Totals Columns
- /// </summary>
- public int TotalColumns{get { return totalColumns; }}
-
- /// <summary>
- /// Get Total Rows
- /// </summary>
- public int TotalRows{get { return totalRows; }}
- /// <summary>
- /// Get Total Cels
- /// </summary>
- /// <returns></returns>
- public int GetLength(){ return totalColumns * totalRows;}
-
- #endregion
- #region Main Methods (LoadGraphicsContent,Initialize,Draw)
- /// <summary>
- /// Load Graphics Content
- /// </summary>
- /// <param name="spriteBatch">XNA Sprite Batch</param>
- /// <param name="texture">texture to use</param>
- public void LoadGraphicsContent(SpriteBatch spriteBatch, Texture2D texture)
- {
- this.spriteBatch = spriteBatch;
- this.texture = texture;
- }
- /// <summary>
- /// Initalize The Image
- /// </summary>
- /// <param name="size">Image Size</param>
- public virtual void Initialize(Vector2 size)
- {
- this.color = Color.White;
- this.scale = Vector2.One;
- this.effects = SpriteEffects.None;
- this.depth = 0.5f;
- this.size = size;
- this.imgsource = CalculatImgSource(1,1);
- this.totalColumns = this.texture.Width / (int)this.size.X;
- this.totalRows = this.texture.Height / (int)this.size.Y;
- strevect = new Vector2(size.X / texture.Width, size.Y / texture.Height);
- }
-
- /// <summary>
- /// Draw Image Without Stretch Option
- /// </summary>
-
- public virtual void DefaultDraw()
- {
- this.spriteBatch.Draw(this.texture, this.position, this.imgsource, this.color, this.rotation, this.origin, this.scale, this.effects, this.depth);
- }
- /// <summary>
- /// Draw The Image
- /// </summary>
-
- public virtual void Draw()
- {
- if (this.stretch == false)
- DefaultDraw();
- else
- StretchDraw();
- }
- /// <summary>
- /// Draw Image With Stretch Option
- /// </summary>
-
- public virtual void StretchDraw()
- {
- this.spriteBatch.Draw(this.texture, this.position, new Rectangle(0,0,texture.Width,texture.Height), this.color, this.rotation, this.origin, strevect, this.effects, this.depth);
- }
- #endregion
- #region Additional Functions(CalculatImgSource,SetSourceImage,SetOrigin)
- /// <summary>
- /// Set The Source Image ( If It's Sprite Or Animation )
- /// </summary>
- /// <param name="row">The Row Or The Animation</param>
- /// <param name="column">The Column Or The Frame</param>
- public void SetSourceImage(int row,int column)
- {
- this.imgsource = CalculatImgSource(row,column);
- }
- /// <summary>
- /// Set The Image Origin
- /// </summary>
- /// <param name="_origin">The Image Origin</param>
- public void SetOrigin(Graphics.Enumeration.EImageOrigin _origin)
- {
- if (_origin == Graphics.Enumeration.EImageOrigin.Center)
- {
- origin = new Vector2(this.size.X/2, this.size.Y/2);
- }
- else if (_origin == Graphics.Enumeration.EImageOrigin.RightDownCorner)
- {
- origin = new Vector2(this.size.X,this.size.Y);
- }
- else
- {
- origin = new Vector2(0,0);
- }
- }
-
- /// <summary>
- /// Calculat The Image Source
- /// </summary>
- /// <param name="row">The Row In The Picture</param>
- /// <param name="column">The Column In The Picture</param>
- /// <returns></returns>
- protected Rectangle CalculatImgSource(int row,int column )
- {
-
- int frameWidth = (int)this.size.X;
- int frameHeight = (int)this.size.Y;
-
-
- this.totalColumns = this.texture.Width / frameWidth;
- this.totalRows = this.texture.Height / frameHeight;
-
- if (row > totalRows) row = totalRows;
- if (column > totalColumns) column = totalColumns;
- if (row < 1) row = 1;
- if (column < 1) column = 1;
- int overx = (column - 1) * frameWidth;
- int overy = (row - 1) * frameHeight;
-
- return new Rectangle(overx, overy, frameWidth, frameHeight);
- }
- #endregion
- }
- }
-
//WWW.CHIMERA2D.COM
//Le Site Contient en plus des code sources et executable du projet une documentation complete online et telechargable ansi que des tutorials et de sources
#region Info/Author
//----------------------------------------------------------------------------
// Author: Tazi Mehdi
// Source: Chimera 2D GAMES ENGINE
// Info: Image public class : Basic public class
//-----------------------------------------------------------------------------
#endregion
#region Using Statement
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
#endregion
namespace Chimera.Graphics
{
/// <summary>
/// This Class Allow You To Use An Image
/// </summary>
public class Image : Helpers.Interface.IDrawable, Helpers.Interface.IDrawables
{
/// <summary>
/// The Default Constructor
/// </summary>
public Image()
{
//SetOrigin(Chimera.Graphics.Enumeration.EImageOrigin.Center);
}
#region Fields(spriteBatch,texture,imgsource,origin,position,size,rotation,color,scale,effects,depth)
private SpriteBatch spriteBatch;
private Texture2D texture;//la texture contient une ou plusieur images
protected Rectangle imgsource;//X,Y image a dessiner
protected Vector2 origin; //origine de l'image par defaut : haut agauche
private Vector2 position;
private Vector2 size;
private float rotation;
private Color color;
private Vector2 scale;
private Vector2 strevect = Vector2.Zero;
private bool stretch = false;
private SpriteEffects effects;
protected float depth;
protected int totalColumns;
protected int totalRows;
#endregion
#region Properties(Position,Size,Rotation,Color,Scale)
/// <summary>
/// Get Or Set The Image Position
/// </summary>
public Vector2 Position
{
get { return position; }
set { position = value; }
}
/// <summary>
/// Get Reference The SpriteBatch
/// </summary>
public SpriteBatch SpriteBatch
{
get { return this.spriteBatch; }
}
/// <summary>
/// Get Or Set Image Size
/// </summary>
public Vector2 Size
{
get { return size; }
set {
size = value;
strevect = new Vector2(size.X / texture.Width, size.Y / texture.Height);
}
}
/// <summary>
/// Get Reference to Texture2D
/// </summary>
public Texture2D Texture
{
get { return this.texture;}
}
/// <summary>
/// Get Or Set The Origin Of Image
/// </summary>
public Vector2 Origin
{
get { return origin; }
set { origin = value; }
}
/// <summary>
/// Enable Or Disable The Stretch Mode
/// </summary>
public bool Stretch
{
get { return stretch;}
set { stretch=value ;}
}
/// <summary>
/// Get Or Set Rotation Degree
/// </summary>
public float Rotation
{
get { return rotation; }
set { rotation = value; }
}
/// <summary>
/// Get Or Set The Image Depth
/// </summary>
public float Depth
{
get { return depth; }
set { depth = value; }
}
/// <summary>
/// Get Or Set Image Color
/// </summary>
public Color Color
{
get { return color; }
set { color = value; }
}
/// <summary>
/// Get Or Set Image Scale Value
/// </summary>
public Vector2 Scale
{
get { return scale;}
set { scale = value;}
}
/// <summary>
/// Get Totals Columns
/// </summary>
public int TotalColumns{get { return totalColumns; }}
/// <summary>
/// Get Total Rows
/// </summary>
public int TotalRows{get { return totalRows; }}
/// <summary>
/// Get Total Cels
/// </summary>
/// <returns></returns>
public int GetLength(){ return totalColumns * totalRows;}
#endregion
#region Main Methods (LoadGraphicsContent,Initialize,Draw)
/// <summary>
/// Load Graphics Content
/// </summary>
/// <param name="spriteBatch">XNA Sprite Batch</param>
/// <param name="texture">texture to use</param>
public void LoadGraphicsContent(SpriteBatch spriteBatch, Texture2D texture)
{
this.spriteBatch = spriteBatch;
this.texture = texture;
}
/// <summary>
/// Initalize The Image
/// </summary>
/// <param name="size">Image Size</param>
public virtual void Initialize(Vector2 size)
{
this.color = Color.White;
this.scale = Vector2.One;
this.effects = SpriteEffects.None;
this.depth = 0.5f;
this.size = size;
this.imgsource = CalculatImgSource(1,1);
this.totalColumns = this.texture.Width / (int)this.size.X;
this.totalRows = this.texture.Height / (int)this.size.Y;
strevect = new Vector2(size.X / texture.Width, size.Y / texture.Height);
}
/// <summary>
/// Draw Image Without Stretch Option
/// </summary>
public virtual void DefaultDraw()
{
this.spriteBatch.Draw(this.texture, this.position, this.imgsource, this.color, this.rotation, this.origin, this.scale, this.effects, this.depth);
}
/// <summary>
/// Draw The Image
/// </summary>
public virtual void Draw()
{
if (this.stretch == false)
DefaultDraw();
else
StretchDraw();
}
/// <summary>
/// Draw Image With Stretch Option
/// </summary>
public virtual void StretchDraw()
{
this.spriteBatch.Draw(this.texture, this.position, new Rectangle(0,0,texture.Width,texture.Height), this.color, this.rotation, this.origin, strevect, this.effects, this.depth);
}
#endregion
#region Additional Functions(CalculatImgSource,SetSourceImage,SetOrigin)
/// <summary>
/// Set The Source Image ( If It's Sprite Or Animation )
/// </summary>
/// <param name="row">The Row Or The Animation</param>
/// <param name="column">The Column Or The Frame</param>
public void SetSourceImage(int row,int column)
{
this.imgsource = CalculatImgSource(row,column);
}
/// <summary>
/// Set The Image Origin
/// </summary>
/// <param name="_origin">The Image Origin</param>
public void SetOrigin(Graphics.Enumeration.EImageOrigin _origin)
{
if (_origin == Graphics.Enumeration.EImageOrigin.Center)
{
origin = new Vector2(this.size.X/2, this.size.Y/2);
}
else if (_origin == Graphics.Enumeration.EImageOrigin.RightDownCorner)
{
origin = new Vector2(this.size.X,this.size.Y);
}
else
{
origin = new Vector2(0,0);
}
}
/// <summary>
/// Calculat The Image Source
/// </summary>
/// <param name="row">The Row In The Picture</param>
/// <param name="column">The Column In The Picture</param>
/// <returns></returns>
protected Rectangle CalculatImgSource(int row,int column )
{
int frameWidth = (int)this.size.X;
int frameHeight = (int)this.size.Y;
this.totalColumns = this.texture.Width / frameWidth;
this.totalRows = this.texture.Height / frameHeight;
if (row > totalRows) row = totalRows;
if (column > totalColumns) column = totalColumns;
if (row < 1) row = 1;
if (column < 1) column = 1;
int overx = (column - 1) * frameWidth;
int overy = (row - 1) * frameHeight;
return new Rectangle(overx, overy, frameWidth, frameHeight);
}
#endregion
}
}
Conclusion
WWW.CHIMERA2D.COM Le Site Contient en plus des code sources et executable du projet une documentation complete online et telechargable ansi que des tutorials et de sources
Sources du même auteur
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Modification suite à l'installation de XNA [ par Frederick_Etudiant ]
Bonjour et bonne année à tous,J'ai installé Microsoft Visual C# 2005 Express Edition, puis XNA game express 1.0J'ai ensuite voulu recommencer les tut
Tutoriels pour XNA [ par Frederick_Etudiant ]
XNA est passé à une nouvelle version en décembre 2006.Le problème est que tout les tutoriels, que j'ai trouvés, ne marche que sur la version béta.Quel
Texture2D Xna Framework [ par oualla_mohamed ]
Salut à tous,Je suis entain de m'initier au Xna Framework.J'ai une texture 2d que j'affiche complétement avec un effet de zoom ( ex: 0.5 , 2 ,2.5).J'
Un blog de développement de jeux video sous XNA [ par MaxSoldier ]
Tout est dans le titre ou presque. Mon équipe et moi créeons en ce moment un site sur la programmation de jeux video grâce à XNA. Les tutoriaux sont f
XNA Error [ par T_Mehdi ]
bonjour tout le monde :)j'ai une drole d'erreur , je mexpliqueLorsque j'essey d'executer un executable realisé sous XNA sur n'importe quelle machine c
xna shoot [ par noun29 ]
Bonjour j'essaye de developper un shmup en xna mais je commence juste avec ce langage. J'ai reussi a faire un vaisseau que l'on peux deplacer avec le
Cherche blogueur XNA [ par MaxSoldier ]
Bonjours à tous !J'avais monté un blog il y a quelque temps que j'ai du abandonner. Il parlait de développement XNA et offrait aux débutants des tutor
XNA et audio [ par gabs77 ]
Bonsoir,je suis en train de faire un jeu en xna pour m'amuser un petit peu et je cherche à intéger de l'audio.j'ai vu quelques tuto qui parle de 3 cla
[XNA] Mon projet n'est plus compatible sur les autres PC !! [ par daikyo ]
Bonjour, Je rencontre un petit problème concernant le partage de mon projet, je souhaite envoyer le "Debug" ou même la "Release" comme je le fais depu
Exportations de projets XNA [ par nfs65 ]
Bonjour,Je me suis attaqué depuis peu à XNA, j'ai installé des tous les composants comme expliqué sur XNA Creator, donc tout fonctionne parfaitement c
|
Derniers Blogs
UNE JOLIE-HORLOGE ET PAS QU'UN PEU !UNE JOLIE-HORLOGE ET PAS QU'UN PEU ! par neodante
Pour les possesseurs d'iPhone, ça y est Bijin Tokei - qui se traduit littéralement en Français par " Jolie Horloge " - est arrivé et GRATUITEMENT s'il vous plaît ! Après la version Tokyo, Hokkaido, night club, racing, Gal, "pour les mademoiselles'", . voi...
Cliquez pour lire la suite de l'article par neodante TECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICESTECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICES par ROMELARD Fabrice
Animé par: Gaetan Bouveret et Julien Chomarat Business Connectivity Services (BCS) est dans SharePoint 2010 la version 2 de Business Data Catalog (BDC dans SharePoint 2007). Il s'agit de la solution permettant de visualiser des données provenan...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE par orion
Comme de nombreux geek, je suis un grand amateur de série TV et je rate régulièrement des épisodes de mes séries préférés. Une solution s'offre à vous avec ce merveilleux site : Tv Gorge - www.tvgorge.com Moteur de recherche à l'appui, vous pouvez ...
Cliquez pour lire la suite de l'article par orion TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Vincent Bellet et Baptiste Giraudier La BI dans SharePoint 2010, Les nouveaux services d'application dans SP2010 et SQL Server Reporting services 2008 R2. La BI dans SharePoint est généralisée pour tous afin de permettre à tous les coll...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
|