Unique Digital Ideas for Business

Develop a blockchain-based loyalty program that offers secure and transparent rewards, fostering customer trust and creating a competitive edge in the market.

Main Office

123 Main Street, Anytown, USA

Follow Us

Edit Template

Merlin’s Demon War

/ /

Merlin's Demon War

This was my first ever project in Unity. This project was part of the IVGC (Introduction to Video Games Creation) course. The IVGC course is what got me into game development and since then I haven’t looked back.

This is a typical turn-based card combat game. Using different types of card uses different amounts of mana balls. For Example using a ‘Fire & Ice’ card uses 3 mana balls, if you have 2 mana balls you can’t use this card. You can increase your mana ball count if you skip your turn. But, you must be very careful while skipping your turn. There is also healing potion as well as a mirror card that just mirrors the attack done by either the player or the enemy.

Gameplay Video
What I Learned
  • Coroutine-based Game Flow Management
  • Object-Oriented Design with Classes
  • Data Structures and List Management
  • Drag-and-Drop System (UI & Input Handling)
  • Card Interaction and Mechanics
  • Audio-Visual Effects System
  • Game Controller and Centralized Management
  • Animation Control via Code
  • Turn-Based Gameplay Logic
  • Health and Damage Handling
How I Implemented these Concepts
Coroutine-based Game Flow Management

 

Used StartCoroutine() to control game mechanics instead of relying on Update().

 
Object-Oriented Design with Classes

 

Created Deck and instantiated playerDeck and enemyDeck to manage card distribution.

Created Hand to manage playerHand and enemyHand, tracking card positions, animations, and ownership (isPlayers).

Implemented CardData as a ScriptableObject to store reusable card properties.

Designed an Effect class to trigger sprite and audio effects when a card is used.

Data Structures and List Management

 

Used List<CardData> in Deck.cs to maintain and randomize card order.

Managed Card[] arrays in Hand.cs to keep track of active cards in a player’s hand.

 
Drag-and-Drop System (UI and Input Handling)

 

Implemented DragAndDrop.cs using IBeginDragHandler, IDragHandler, and IEndDragHandler for player interaction.

Added logic to highlight valid card placements and trigger effects upon dropping a card.

Card Interaction and Mechanics

 

Designed BurnZone.cs to allow players to discard cards by dragging them into the burn zone, triggering a sound effect.

Implemented Card.cs to initialize and display card visuals (title, description, cost, damage, etc.).

 
Audio-Visual Effects System

 

Used Effect.cs to trigger visual (sprite changes) and audio effects (PlayIceSound(), PlayFireballSound()).

 
Game Controller and Centralized Management

 

GameController likely acts as a singleton (GameController.instance), handling game state, turns, and interactions.


A snippet of code that shows how I used the instance of the GameController to handle the mana balls count for both the player and the enemy.

I also made some variables as public so I could assign them directly in the editor by dragging and dropping it.

 
Animation Control via Code

 

Used Animator.CrossFade() in Deck.cs to smoothly transition card animations when dealing new cards.

 
Turn-Based Gameplay Logic

 

Implemented NextPlayersTurn() in GameController to handle switching between player and enemy turns.

 
Health and Damage Handling

 

Applied different damage types (Fire, Ice, etc.) in Effect.cs, adjusting values based on target attributes (isFire).

Screenshots