Player class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace WindowsGame3
{
class Player
{
public Texture2D texture;
public int health;
public Vector3 location = new Vector3(0, 0, 0);
public Vector2 velocity = new Vector2(0,0);
//make weapon class then add weapon attribute
public Player(Texture2D a, int b, Vector3 c)
{
texture = a;
health = b;
location = c;
}
public void Update(double dTime)
{
location.X += velocity.X * (float)dTime;
location.Y += velocity.Y * (float)dTime;
}
public void Attack()
{
}
}
}
error occurring on this line
if (player.velocity.X != 0f && player.velocity.Y != 0f)
kind of new to c# programming and not sure why I'm getting this error. Any help would be greatly appreciated

New Topic/Question
Reply



MultiQuote








|