Hi...! I'm Workihng on Snake And Laddet Game... the player roll the dice and it's get a new position,an image will show the player position on the screen in the next turn image will move to a new position but the last picture is still in it's position how can i remove last picture?!
thansk...!

Recommended Answers

All 9 Replies

Could you give a bit more info?
Or is this helpfull enough?

Allright...!
in this picture the first player roll the dice for the first time and the plyayer one marker (with color bisque) move to it's position.
in this pic we see the first player next move and the player marker is in the new position but player last marker is still in it's position i want that the last player market to be removed... how can i do that?!
all markers are label...
thanks..

Allright...
in this picture the first player roll the dice for hte first time and the player makrker(with color bisque) move to the new position...
in this picture the player roll the dice for the second time and player one marker move to new postion but player one last time marker is still in it's poistion i want player new place marker to be shown on the screen(ONLY),in other word i want that player other or last markers to be removed or hidden,notice that all the markers are label...
thanks....

If each player is a label placed over top of the board, then changing the location of the label will make the piece move and not copy itself. Are you sure you're not creating a new label and placing that? All this is speculation without some code to go by

Yeah i create a new label for that... how can i remove latest labels?!

Instead of creating a new label, just change the location property of the existing label. You might have to make the declaration for that label, global(inside the class but ouside of any subroutines). If that doesn't work for you, you could call the .Dispose() method of the label. But I would strongly recommend just re-using the same label, it's much more efficient and cleaner.

If you keep your labels in a List<Label> you could try to remove labels at a certain index.

**Bold Text Here

messagebox.show("hi");

**

Why do I feel this is for a final project? Since this sound VERY similar to a final project for a C# class I had years ago.

But anyway, that last image, you just need to redraw it.

The project I had, the professor dubbed it "The Tortoise and the Hare". We had the gameboard with images on them, however these were panels that we then draw on. When the player would hover their mouse over a square it would tell them the requirements needed to move to that square and on leaving the square we woulld redraw the image on it (also we had to use #s on the square the player was on, had to redraw the square they left, and then draw the new square they are on)

On yes I should add, I had an array with numbers in it, that represented what image each square should be, so the program always knew what each square should have for an image by referencing this array, with the index being the square we were interacting with, and then comparing the # to a series of if/else statements

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.