简体   繁体   中英

how do i make board for snake & ladder game in java?

I am facing difficulty in implementing the 10*10 board of snake and ladder game in java. I am not able to implement such a screen.What should I do? I tried implementing it with a image nd then moving over image with the positions but with this way i am not able tocomplete it. Is there any good way of implementing this?????

Simple Create A a gird(10*10) and a button [10][10] array, set these button on grid. now split 1 snake and ladder game background image in 100 pic. set these spited image on buttons. now you can access your every number(1-100) position var b[i,j] and set player icon on this button.

Just a thought, have the original image in a frame and overlay this frame with a transparent image with the same conditions as the orignial image (meaning the snake and ladder coordinates should be the same as the original board). Now play the game in the transparent image so that you may not worry about repainting the original image.

As told by Joel please post the code to understand better.

This link has a design of that game. May be you can take a look.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM