edogdu / RAM_Cyber_Defenders

Cybersecurity Learning Game in AR/VR Environment
2 stars 1 forks source link

Game Logic #5

Closed LightTheBlues closed 5 months ago

Luk-Er4 commented 6 months ago

Cyber Defense Guardian C++.zip

This is the simulation of the game we are working on. It is written in C++.

Luk-Er4 commented 6 months ago

In the logic part, I need to work on the below.

[Placing the cards based on the rules]

  1. Players should place the card based on its color. They must place blue cards only on the blue section. It must be also applied to green and red cards.
  2. Placing blue cards on the blue section will allow players to put green cards on their green section.
  3. Placing blue cards on the blue section will allow opponents to put red cards on their red section.
  4. Depending on the attributes of the blue card, players will be allowed to or not allowed to place those cards.
  5. When players cannot place their cards because of the rules, they should place their cards on the waste deck.

[Interacting with cards based on the rules]

  1. When players place red cards, there are three(except one case)cases. 1) They can destroy green or blue cards. 2) They can destroy only green cards. 3) They can destroy only blue cards. x) They have no cards to destroy. -> This case has already been handled previously.
  2. When the cards are destroyed, they should be eliminated from the game board. Then, the waste deck should increase the count of them.
  3. When there are no cards left on the deck, then show the result.
Luk-Er4 commented 6 months ago

image

image

Interaction Layer Mask enabled me to put cards in the desired spot. Basically, in the previous work, we had sockets to place cards in the right place but here is the problem. The blue area is supposed to take only blue cards but we could place green and red cards as well. Since this is not the way we want, we had to solve this problem. I could handle it by using the interaction layer.

If the two objects have the same interaction layer, then they become interactable. For example, I set blue cards and blue card sockets as "Blue", green cards and green card sockets as "Green", and red cards and red card sockets as "Red". That allows me to put the cards in my desired spot.

Luk-Er4 commented 6 months ago

New mains.zip

I could clean up my C++ code by splitting a big function into smaller ones so that I can easily translate them into C# and also give them a little difference to Unity. My future work for now is to create classes in order to make a library for this game.

Luk-Er4 commented 5 months ago

C++ and C Sharp.zip

I could not fix the errors on the C Sharp file, but it gives general ideas of the game logic.

updated C++.zip New update on C++ at 06:53 3/21. Wasting the card is enabled. Added comments for enabling player vs computer mode.