
EBrown
Page: 1 2
Page: 1 2
b95c375f9a0cd0ba7e92ce85fc5c5bae
public void Update(float delta) // Time in seconds since last update.
{
float speed = 0.02; // This is the time each frame should take
int missedFrames = (int)(delta / speed);
for (int i = 0; i < missedFrames; i++)
{
// Do frame logic here.
}
}
{
float speed = 0.02; // This is the time each frame should take
int missedFrames = (int)(delta / speed);
for (int i = 0; i < missedFrames; i++)
{
// Do frame logic here.
}
}
Building.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
namespace CityScape
{
class Building
{
public int x;
public int y;
public BuildingType type;
public int status;
public Development development;
public Vector2 footprint = new Vector2();
public bool hasPower = false;
public int powerCost = 100;
public List<int> neighbors = new List<int&g
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
namespace CityScape
{
class Building
{
public int x;
public int y;
public BuildingType type;
public int status;
public Development development;
public Vector2 footprint = new Vector2();
public bool hasPower = false;
public int powerCost = 100;
public List<int> neighbors = new List<int&g
Update
#region Update
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == Butto
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == Butto
Clean Roads
#region Clean Roads
public void CleanRoads(int baseX, int baseY)
{
for (int x = (baseX - 3 > 0 ? baseX - 3 : 0); x < (baseX + 3 < mapWidth - 1 ? baseX + 3 : mapWidth); x++)
{
for (int y = (baseY - 3 > 0 ? baseY - 3 : 0); y < (baseY + 3 < mapHeight - 1 ? baseY + 3 : mapHeight); y++)
{
if (mapData[x, y] == (int)TileType.RoadBridgeBlank || mapData[x, y] == (int)TileType.RoadBridgeHorizon
public void CleanRoads(int baseX, int baseY)
{
for (int x = (baseX - 3 > 0 ? baseX - 3 : 0); x < (baseX + 3 < mapWidth - 1 ? baseX + 3 : mapWidth); x++)
{
for (int y = (baseY - 3 > 0 ? baseY - 3 : 0); y < (baseY + 3 < mapHeight - 1 ? baseY + 3 : mapHeight); y++)
{
if (mapData[x, y] == (int)TileType.RoadBridgeBlank || mapData[x, y] == (int)TileType.RoadBridgeHorizon