This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public SpriteState() | |
{ | |
sonicSprite = new Sprite(new Vector2(50, 50), "2d//soniclg4"); | |
sonicSprite.LoadContent(); | |
sonicSprite.PrepareAnimation(50, 41); | |
sonicSprite.AddAnimation("down", new int[] { 0, 1, 2, 3 }, 25, false); | |
sonicSprite.AddAnimation("left", new int[] { 4, 5, 6, 7 }, 25, false); | |
sonicSprite.AddAnimation("right", new int[] { 8, 9, 10, 11 }, 25, false); | |
sonicSprite.AddAnimation("up", new int[] { 12, 13, 14, 15 }, 25, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Microsoft.Xna.Framework; | |
using Microsoft.Xna.Framework.Graphics; | |
using Microsoft.Xna.Framework.Input; | |
using Yna.Display; | |
using Yna.Input; | |
namespace Yna.Test | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Yna; | |
using Yna.Display; | |
namespace Yna.Test | |
{ | |
public class Game2 : Yna.YnGame | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Microsoft.Xna.Framework; | |
using Microsoft.Xna.Framework.Graphics; | |
using Microsoft.Xna.Framework.Input; | |
using Yna; | |
using Yna.Display; | |
namespace Yna.Test | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Microsoft.Xna.Framework; | |
using Microsoft.Xna.Framework.Graphics; | |
using Microsoft.Xna.Framework.Input; | |
using Yna.Display; | |
using Yna.Input; | |
namespace Yna.Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void AddExplosion(int x, int y) | |
{ | |
Sprite explode = new Sprite("SFX/explosion2"); | |
explode.LoadContent(); | |
explode.Position = new Vector2(x, y); | |
explode.PrepareAnimation(94, 94); | |
explode.AddAnimation("0", new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, 25, false); | |
// Expression Lambda | |
// equivalent à explode.GetAnimation("0").AnimationComplete += onAnimationComplete; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Le rectangle jouable a une résolution réel de 1000x760 | |
* La texture d'origine fait 1280x800 | |
* 1 et 2 : Il y a un décallage de 20px entre le debut de la texture (x ,y) | |
* et la surface de jeu | |
* 1280 / 64 = 20 --> adaptation à chaque résulutions | |
* 3 et 4 : 1280 / (1280 / 1000) = 1280 / 1.28 = 1000 soit la largeur max de la surface jouable | |
* pour avoir la surface jouable relative complète il faut ajouter les 20px de décalage calculé au début | |
* prenant en compte l'échelle | |
*/ | |
this.playableSurface = new Rectangle ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected SpriteSortMode _spriteSortMode; | |
protected BlendState _blendState; | |
protected SamplerState _samplerState; | |
protected DepthStencilState _depthStencilState; | |
protected RasterizerState _rasterizerState; | |
protected Effect _effect; | |
protected Matrix _transformMatrix; | |
protected float _rotation; | |
protected float _zoom; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Drawing; | |
using WiimoteLib; | |
namespace SpaceGame | |
{ | |
public class WiimoteHelper | |
{ | |
private Wiimote wiimote; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace Yna.Utils | |
{ | |
/// <summary> | |
/// An hybrid collection who work like a Stack with the advantages | |
/// of a List. It's a List object with 3 extension methods who simulates a Stack | |
/// </summary> | |
/// <typeparam name="T"></typeparam> |
OlderNewer