Спрайты для морского боя

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Classic «Sea Battle» game on Windows Forms with Enemy bot

malandrii/sea-battle-game-winforms

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

«Sea Battle» on Windows Forms

Classic «Sea Battle» game on Windows Forms with Enemy bot

Читайте также:  Индийский океан моря которые входят

Go to Releases, choose the latest release and click the «sea-battle.exe» or just click here.

Place ships panel => choose ship size => mouse cursor on the field

image

image

Ships horizontality can be changed

image
image

Ships can be arranged randomly

image

After you’ve placed all the ships choose the enemy settings and press «Start Game»

image

Press on the enemy field button. You and enemy go one by one.
If the text of the button is dot — this cell is clear
If cross — you hit the enemy ship

image

Also status helps with that

image

As you hit an enemy ship — you continue your moves until you miss.

As the enemy ship is dead — all the cells around gets covered

image

image

Meanwhile, enemy-bot is attacking our field

image

Game stops as someone destroys all the enemy ships and you can see where they were located

image

EnemyAttackTransparentDarkShadow

Works the same with any ship (also understands if the cell was already shot and goes the opposite way)
This algorithm is the most effective way to play «Sea Battle» (usually people play the same way)

About

Classic «Sea Battle» game on Windows Forms with Enemy bot

Источник

Поле для игры морской бой

Для игры компьютера в морской бой реализовать стратегию в виде дерева
ребят помогите. Тема курсача "Морской бой" само приложение я написал но потом узнал что "Для игры.

Реализация игры морской бой
подскажите плз алгоритм написания морского боя и основные аспекты . мои мысли : поле Как.

Морской Бой — как организовать поле и расстановку кораблей?
Добрый времени суток, необходимо создать игру "Морской Бой", извините за то, что вопрос возможно.

Читайте также:  Сколько градусов черное море абхазия

Разработка класса «Корабль» для игры «Морской бой»
Всем доброго времени суток! Работаю над курсачом. Моя тема: Реализация игры Морской бой. Мне.

Лучший ответ

Сообщение было отмечено Alexandr_Pal как решение

Решение

Добавлено через 18 минут

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
using System.Threading; . //карта int map[,]; //её размеры int sX, sY; //массив спрайтов Bitmap sprites[]; //размеры спрайта int sprSX, sprSY; . //процедура перерисовки public void reDraw() { //pictureBox1 - целевой PictureBox Graphics g = pictureBox1.CreateGraphics(); Monitor.Enter(g); for (int x = 0; x  sX; x++) for (int y = 0; y  sY; y++) g.DrawImage(sprites[map[x, y]], x * sprSX, y * sprSY); Monitor.Exit(g); }

Источник

Оцените статью