Lesson 05.1 - Creating objects from classes
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
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; | |
using Engine; | |
namespace SuperAdventure | |
{ | |
public partial class SuperAdventure : Form | |
{ | |
private Player _player; | |
public SuperAdventure() | |
{ | |
InitializeComponent(); | |
_player = new Player(); | |
_player.CurrentHitPoints = 10; | |
_player.MaximumHitPoints = 10; | |
_player.Gold = 20; | |
_player.ExperiencePoints = 0; | |
_player.Level = 1; | |
lblHitPoints.Text = _player.CurrentHitPoints.ToString(); | |
lblGold.Text = _player.Gold.ToString(); | |
lblExperience.Text = _player.ExperiencePoints.ToString(); | |
lblLevel.Text = _player.Level.ToString(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment