Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to record the player move

How to record the player move

Scheduled Pinned Locked Moved C#
helptutorialquestionworkspace
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    haroon1980
    wrote on last edited by
    #1

    How to record a move of player? I am assuming in AddUser() if username entered is pc then PC image will be added and will start playing with human I have following piece of code: Please help int movenum; private int MoveNumber { get { return movenum; } set { movenum = value; } } public void AddUser(int user, string strText, string img) { lbls = new Label[] { label2, label4 }; pics = new PictureBox[] { pictureBox1, pictureBox2 }; user--; if (strText.Equals("")) { lbls[user].Text = "Guest"; } else { lbls[user].Text = strText; } if (strText.Equals("pc")) { pics[user].SizeMode = PictureBoxSizeMode.StretchImage; pics[user].Load("C:\\WINDOWS\\system32\\setup.bmp"); } else { pics[user].SizeMode = PictureBoxSizeMode.StretchImage; pics[user].Load(img); } userLoggedIn++; } private void switchPlayers() { if (player == 1) { player = 2; } else { player = 1; } checkAll(); } private void box1_Click(object sender, EventArgs e) { if (userLoggedIn == 2) { box1.SizeMode = PictureBoxSizeMode.StretchImage; box1.Image = pics[player - 1].Image; box1.Enabled = false; switchPlayers(); } } private void box2_Click(object sender, EventArgs e) { if (userLoggedIn == 2) { box2.SizeMode = PictureBoxSizeMode.StretchImage; box2.Image = pics[player-1].Image; box2.Enabled = false; switchPlayers(); } } private void box3_Click(object sender, EventArgs e) { if (userLoggedIn == 2) { box3.SizeMode = PictureBoxSizeMode.StretchImage; box3.Image = pics[player - 1].Image; box3.Enabled = false; switchPlayers();

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups