Need help with loading 200 imageboximages.

Battleship game, and need to update all squares on each players board.

  • (2 Pages)
  • +
  • 1
  • 2

19 Replies - 1443 Views - Last Post: 02 June 2010 - 10:02 AM Rate Topic: -----

#16 Guest_Kyle*


Reputation:

Re: Need help with loading 200 imageboximages.

Posted 30 May 2010 - 06:30 PM

Also when I try to use
public Orientation Orientiation { get; set; } //The Battleships orientation  


I get an error that states "The type or namespace name 'Orientation' could not be found (are you missing a using directive or an assembly reference?". I included System.Drawing;, but this did not clear up this single erorr. Sorry and thanks again!
Was This Post Helpful? 0

#17 Guest_Kyle*


Reputation:

Re: Need help with loading 200 imageboximages.

Posted 30 May 2010 - 07:14 PM

I should really make an account so I can edit posts, but I can not also use the cordinate system with e.X and e.Y . It states "'System.EventArgs' does not contain a definition for 'X' and no extension method 'X' accepting a first argument of type 'System.EventArgs' could be found (are you missing a using directive or an assembly reference?).
Was This Post Helpful? 0

#18 FlashM  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 382
  • View blog
  • Posts: 1,195
  • Joined: 03-December 09

Re: Need help with loading 200 imageboximages.

Posted 30 May 2010 - 11:43 PM

As I remember Orientation is an ENUM. For Example:

public enum Orientation
{
   Horizontal,
   Vertical
}


You use it this way:

Battleship myShip = new BattleShip();
myShip.Orientation = Orientation.Horizontal;


something like that...

What event are you using for getting the mouse click coordinate?
Was This Post Helpful? 1
  • +
  • -

#19 elbielefeld  Icon User is offline

  • D.I.C Head

Reputation: 70
  • View blog
  • Posts: 216
  • Joined: 18-May 10

Re: Need help with loading 200 imageboximages.

Posted 31 May 2010 - 07:58 AM

The BattleshipList class implements the generic class List<T>. The List<T> class provides methods to add, remove items to the list. Like an array, but you don't need to worry about the bounds. Generic means, that the the list class can be a list of any object. So the BattleshipList class is a List<Battleship> -> a list which can handle Battleships.

The pictureBox1_Click event does not give you the clicked position, so we use pictureBox1_MouseDown. This is why you get the message "'System.EventArgs' does not contain a definition for 'X'.....

When you get the message "The type or namespace not found" -> right click on the red underlined typename on choose resolve -> using System.Windows.Forms (for orientation)
Was This Post Helpful? 0
  • +
  • -

#20 Guest_Kyle*


Reputation:

Re: Need help with loading 200 imageboximages.

Posted 02 June 2010 - 10:02 AM

Okay, thanks for the help!
Was This Post Helpful? 0

  • (2 Pages)
  • +
  • 1
  • 2