-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNoCol.cs
47 lines (38 loc) · 1.23 KB
/
NoCol.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// NolCol.cs
//Using declarations
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
namespace PlatformerProject
{
class NoCol
{
/// <summary>
/// This class will simply be used to store many non-collidable background objects
/// No collision or anythign else is needed.
///</summary>
Texture2D picture;
Vector2 position;
float width, height;
SpriteBatch batch;
bool active;
public NoCol(Texture2D picture, Vector2 position, SpriteBatch batch)
{
this.picture = picture; // The sprite
this.position = position; // Where the sprite will be drawn
this.width = picture.Width; // the width of the sprite
this.height = picture.Height; //the height of the sprite
this.batch = batch; // Get the batch so we can draw in this Class
}
public void drawNoCol()
{
batch.Draw(picture, position, Color.White) ;
}
public void incrementPosition(float x, float y)
{
position.X += x;
position.Y += y;
}
}
}