Check this stuff out to get an idea of what I’ve been up to.

Vegetable RoundupContact DrawerExtremely Simple Accounting
Vegetable Roundup is a XNA platformer game that is written for the desktop as well as XBOX 360 (could easily be ported to Windows Phone probably). This game is still in progress, due to lack of art assets. The game is based off of the platformer kit released through microsoft.

The whole point of the game is for a rabbit who is riding a squirrel like a horse. You must locate and capture vegetables who have run amok and return them to a boiling pot of stew for supper.

I added Several features to the game, a few of which include:

  • Powerups
  • Boss Enemies
  • Mele Attack
  • Lasso Attack
  • Enemy Drag to a boiling pot of soup for points
  • Sprint/Sprint Jump
  • Health
  • Super Jump off springboard tile
  • Scoreboard
  • etc…

  • Note: Images are from a Test level for feature feasibility testing.

    Code Snippet:
    [cc lang=’csharp’]
    private void UpdateEnemies(GameTime gameTime)
    {
    foreach (Enemy enemy in enemies)
    {
    enemy.Update(gameTime);

    // Touching an enemy instantly kills the player
    if (enemy.IsAlive && enemy.BoundingRectangle.Intersects(Player.BoundingRectangle))
    {
    if (Player.IsPoweredUp)
    {
    OnEnemyKilled(enemy, Player);
    enemyDowns.Add(new EnemyDown(enemy, this, enemy.MonsterType));
    }
    else
    {
    Player.CurrentHealth -= enemy.ContactDamage;
    if (Player.CurrentHealth <= 0) OnPlayerKilled(enemy); else { invulnerableTime = TimeSpan.FromSeconds(2.0); if (Player.Velocity.Length() > 0)
    Player.Velocity = -100 * Player.Velocity;
    else
    Player.Velocity = 100 * (Player.Position – enemy.Position);
    }
    }
    }
    if (enemy.IsAlive && enemy.BoundingRectangle.Intersects(Player.MeleeRectangle))
    {
    if (Player.isAttacking)
    {
    OnEnemyKilled(enemy, Player);
    enemyDowns.Add(new EnemyDown(enemy, this, enemy.MonsterType));
    }
    }

    foreach (Fireball aFireball in Player.mFireballs)
    {
    if (enemy.IsAlive && enemy.BoundingRectangle.Intersects(aFireball.BoundingRectangle))
    {
    OnEnemyKilled(enemy, Player);
    enemyDowns.Add(new EnemyDown(enemy, this, enemy.MonsterType));
    }
    }

    }
    }
    private void OnEnemyKilled(Enemy enemy, Player killedBy)
    {
    enemy.OnKilled(killedBy);
    }

    public void UpdateDeadEnemies(GameTime gameTime)
    {
    foreach (EnemyDown deadEnemy in enemyDowns)
    {
    if (deadEnemy.BoundingBox.Intersects(Player.BoundingRectangle)
    && Player.AttemptingToGrab && Player.DraggedEnemy == null)
    {
    deadEnemy.grab(Player);
    Player.DraggedEnemy = deadEnemy;
    }
    else if (Player.AttemptingToDrop)
    {
    deadEnemy.drop();
    Player.DraggedEnemy = null;
    }
    deadEnemy.Update(gameTime);
    }
    }
    [/cc]

The contact drawer is a simple contact list with form validation. You can enter your clients into the list and enter some basic information about them. Then you save it to a file, that way you can share the file with others.

Code Snippet:
[cc lang=’csharp’]
//First Name Form Validation!
void txtFirstN_KeyPress(object sender, KeyPressEventArgs e)
{
int c = e.KeyChar;
int len = ((TextBox)sender).Text.Length;
((TextBox)sender).SelectionStart = len;

if (c != 8)
{
if (len < 20) //20 length char content { if ((c < 65 || c > 90) && (c < 97 || c > 122)) //not letter
{
e.Handled = true;
}
else if (((TextBox)sender).Text.IndexOf(” “) == (len – 1))
{

if (c > 96 && c < 123)//lower case char { e.KeyChar = (char)(c - 32); } } } else //only 20 char long { e.Handled = true; } } } [/cc] [/tab] [tab title="File Report"]File report creates a list of files from a target location which options to search inside folders. Then you can save this list to a file and share that file to whoever wants to see which files you have! Useful! [gallery columns="4" ids="207,208,210,209"] Code Snippet: [cc lang='csharp'] //Readable File Size foreach (FileInfo f in files) { size += f.Length; long bytes = f.Length; string[] suf = { "B", "KB", "MB", "GB", "TB", "PB" }; int place = Convert.ToInt32(Math.Floor(Math.Log(bytes, 1024))); int place2 = Convert.ToInt32(Math.Floor(Math.Log(size, 1024))); double num = Math.Round(bytes / Math.Pow(1024, place), 1); string readable = num.ToString() + suf[place]; double totalsize = Math.Round(size / Math.Pow(1024, place2), 1); totalreadable = totalsize.ToString() + suf[place2]; toolStripStatusLabel2.Text = totalreadable; string[] row = new string[] { f.Name, readable.ToString() }; dg1.Rows.Add(row); //add name to col. al.Add(f.Name); } [/cc] [/tab] [tab title="Find and Build"]Find and build is a .NET web application that connects contractors to client. This was for my 'Advanced Internet Applications' course in College. The webpage contains several features including:

  • Bidding System
  • Job search function
  • Form Validation
  • Job bid acceptance MSG center
  • etc…

Since this was for school there were a few restrictions, the most notable was that we were forbidden to use a login/password system. So we employed drop down menus to select a profile, which is obvious completely lacking in security.

The visual element was not required for this project, but a minimal design was created to illustrate the capabilities of the project.

Mark: A+

Code Snippet:
[cc lang=’csharp’]
//View Jobs Page Load Method.
protected void Page_Load(object sender, EventArgs e)
{
//Retrieve values from query string in order to set appropriate page structure
NameValueCollection qsData = Request.QueryString;
userType = qsData.Get(“type”);
id = qsData.Get(“id”);
name = qsData.Get(“name”);

//Retrieve the job ids
jobID = (ArrayList)Session[“jobID”];

//If querystrings are null, redirect to main page
if (userType == null || id == null || name == null)
{
Response.Redirect(“Default.aspx”);
}

//Set the appropriate url and query string for the home link
hlHome.NavigateUrl = “Main2.aspx?type=” + userType + “&id=” + id + “&name=” + name;

if (!IsPostBack)
{
string connStr = ConfigurationManager.ConnectionStrings[“connStrDb1”].ConnectionString;
SqlConnection conn = null;
try
{
conn = new SqlConnection(connStr);
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
string command1 = “SELECT [tJob].[jobID], [category], [jobName], [description], [location], [status], [lowestOfferer], [lowestOffer] FROM [tJob], [tOffer] WHERE [tOffer].[jobID] = [tJob].[jobID] AND [clientID] = ‘” + id + “‘”;
cmd.CommandText = command1;
SqlDataReader dr = cmd.ExecuteReader();

//If the user has not created any jobs, display message
if (dr.HasRows == false)
{
lblNoJobs.Text = “You have not yet created any jobs”;
lblAcceptOffer.Visible = false;
lblJobId.Visible = false;
txtJobId.Visible = false;
cmdAcceptOffer.Visible = false;
}

GridView1.DataSource = dr;
GridView1.DataBind();
dr.Close();
conn.Close();

}
catch (SqlException)
{
//Catch any errors and display error message
if (conn != null)
{
conn.Close();
}
lblError.Visible = true;
lblError.Text = “Sorry, your task could not be completed at this time. Please try again in a few moments.”;
}
}
}
[/cc]


This program saves simple accounting information to a random file. It’s pretty simple and these screenshots are self-explanatory.

Code Snippet:
[cc lang=’csharp’]
void txtBalance_KeyPress(object sender, KeyPressEventArgs e)
{
int c = e.KeyChar;
int len = ((TextBox)sender).Text.Length;
((TextBox)sender).SelectionStart = len;

if (c != 8)
{
if (len == 0)
{
if (c > 57 || c < 48) { e.Handled = true; } } else if (len > 1)
{
if (c < 48 || c > 57)
{
if (c == 46)
{
if (((TextBox)sender).Text.IndexOf(“.”) > -1)
{
e.Handled = true;
}
}
else
{
e.Handled = true;
}

}

}
else if (((TextBox)sender).Text.IndexOf(“.”) > -1)
{
if(len == (((TextBox)sender).Text.IndexOf(“.”) +3))
{
e.Handled = true;
}
}

}
}
[/cc]

This is an ad!