-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new file: CharacterTest.cs new file: Forest 01a.JPG new file: Game1.cs new file: Game1Test.cs new file: Program.cs new file: ProgramTest.cs new file: Sprite.cs new file: SpriteTest.cs new file: test.png
- Loading branch information
Showing
14 changed files
with
138 additions
and
25 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Microsoft.Xna.Framework; | ||
using Microsoft.Xna.Framework.Input; | ||
using Microsoft.Xna.Framework.Content; | ||
using Microsoft.Xna.Framework.Graphics; | ||
|
||
namespace WindowsGame1 | ||
{ | ||
class AnimatedSprite : Sprite | ||
{ | ||
float timer = 0f; | ||
float interval = 200f; | ||
int currentFrame = 0; | ||
int spriteWidth = 32; | ||
int spriteHeight = 48; | ||
int spriteSpeed; | ||
Rectangle sourceRect; | ||
Vector2 origin; | ||
|
||
public AnimatedSprite() | ||
{ | ||
} | ||
|
||
public void HandleSourceRect(GameTime gameTime) | ||
{ | ||
|
||
sourceRect = new Rectangle(currentFrame * spriteWidth, 0, spriteWidth, spriteHeight); | ||
|
||
origin = new Vector2(sourceRect.Width / 2, sourceRect.Height / 2); | ||
} | ||
|
||
|
||
|
||
public Vector2 Position | ||
{ | ||
get { return pos; } | ||
set { pos = value; } | ||
} | ||
|
||
public Vector2 Origin | ||
{ | ||
get { return origin; } | ||
set { origin = value; } | ||
} | ||
|
||
public Texture2D Texture | ||
{ | ||
get { return tex; } | ||
set { tex = value; } | ||
} | ||
|
||
public Rectangle SourceRect | ||
{ | ||
get { return sourceRect; } | ||
set { sourceRect = value; } | ||
} | ||
|
||
|
||
} | ||
} |
Binary file not shown.
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace WindowsGame1 | ||
{ | ||
class Menu | ||
{ | ||
|
||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.