Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

C-Builder - Chess with OOP (classes)


Rekomendowane odpowiedzi

Opublikowano

Hello. Sorry but I am not PL, so I will write in English. Hope you understand me!

 

I got to create a Chess program in C-builder using Object Orietend Programming. If someone knows please help me! It doesn't have to be with rules. Just moving pieces randomly.

 

---

Cześć. Przepraszam, ale nie jestem z Polski, więc będę pisać po angielsku. Mam nadzieję, że mnie zrozumiecie!
 
Muszę stworzyć program szachowy w C-builder korzystając programowania obiektowego. Jeśli ktoś zna to proszę o pomoc! Gra nie musi zawierać reguł szachów, wystarczą losowe ruchy pionków.
Opublikowano
Welcome,

 

I'm not programming in C so I can't help you but I'll help with posts translate into English or Polish for better communication :)

I'll edit post with translation like yours.

 

Jeżeli ktoś chce pomóc, to może śmiało po polsku pisać - przetłumaczę w razie potrzeby.

Opublikowano

Did you mean C++ builder?

 

Just create class 'Figure' in which you can keep its position and TImage object. You can implement for this class picture loading method and create pure virtual method for handling movement (bascially if you can move in particular position or not). Then you can introduce classes for each figure which will derive from Figure class and implement logic for movement method.

The board itself can be just another TImage object with the image of the board... ;)

Then you can introduce player class which will own set of figures, with respective types, and color.

Game logic is up to you.

YOU MUST DIE

- Ganon, Koridai

Opublikowano

 

Did you mean C++ builder?

 

Just create class 'Figure' in which you can keep its position and TImage object. You can implement for this class picture loading method and create pure virtual method for handling movement (bascially if you can move in particular position or not). Then you can introduce classes for each figure which will derive from Figure class and implement logic for movement method.

The board itself can be just another TImage object with the image of the board... ;)

Then you can introduce player class which will own set of figures, with respective types, and color.

Game logic is up to you.

 

This is what I made: http://www85.zippyshare.com/v/TtrpIDuJ/file.html

https://www.virustotal.com/pl/file/c5e41f92caab8a99e048845bf73d3ad19b39a11ed34c671a350309091d8bdd6f/analysis/1483193324/

 

Now I just need to make the pieces move randomly. I don't know how to do that.

 

---

Zrobiłem coś takiego: (link wyżej)

Teraz muszę zrobić losowe ruchy pionków ale nie wiem jak.

Opublikowano

 

Did you mean C++ builder?

 

Just create class 'Figure' in which you can keep its position and TImage object. You can implement for this class picture loading method and create pure virtual method for handling movement (bascially if you can move in particular position or not). Then you can introduce classes for each figure which will derive from Figure class and implement logic for movement method.

The board itself can be just another TImage object with the image of the board... ;)

Then you can introduce player class which will own set of figures, with respective types, and color.

Game logic is up to you.

 

This is what I made: http://www85.zippyshare.com/v/TtrpIDuJ/file.html

 

Now I just need to make the pieces move randomly. I don't know how to do that.

 

Sorry but you need to include scan of this file (or paste clear code eg. on Pastebin.com)

Use for scan: https://www.virustotal.com/

I'll wait 1h for this.

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...