My Portfolio
Tile-based games

Several strategy projects.

City Builder

This project was made to manage a resource system for a simple turn-based game. The goal is to reach a maximum of population. Each turn allows to upgrade or build one building. There is maximum capacity for the city (top right corner).
The game ends when one of the 3 goal resource is depleted (science, religion or politics). Others resources are made to upgrades specifics buildings
The camera scripts is the same as in others strategy games and the grid is composed of squared GameObjects with Colliders and a raycast system checking 4 directions.

iPhone app
            preferences selection screen
iPhone app
            preferences selection screen

Hex City Builder

Based on the previous project , this game uses a hexagonal grid instead of a squared one. Now the player can choose between three buildings (bottom of the screen), then he can place the selected buiding on one of the empty hex.
Each building is a small "quest" where the player has to place the right building type next to it to fulfill the requirement. The quest is represented by the small icons at the top of buildings. Each time a part of the quest is solved, the icon deseappers.
The game is endless and the lose condition is reached when X buildings have incompleted quests( a quest is incomplete when the tile is surrounded and there is no more space to fulfill the goals).

Camera Script

This script is used is all my strategy games. It is attached to a ParentObject of the Main Camera.
The script uses parameters to manage the zoom and move speed and can rotate all around the pivot object. It is using the the old Input system (made on 2019.v).
The player can move and play the game only with the mouse with this control mapping:
When the left mouse button is pressed the player can zoom with the scrollwheel and can move the selected objects while moving the mouse.
While the left button is pressed,we can press the scrollwheel to move the empty pivot object on a place like a RTS.
While the left button is pressed,we can press the right button to rotate the camera around the empty pivot object.


_______________________________________________________________________




public delegate void OnHauteurChangeDelegate(float newValue);
public event OnHauteurChangeDelegate OnHauteurChange;

public static CameraController instance;

private void Awake()
{
    instance = this;
    canVerticalMove = true;
}

private void Start()
{
    cam = Camera.main;
    curZoom = cam.transform.localPosition.y;
    curXRot = -60;
    transform.eulerAngles = new Vector3(curXRot, transform.
    eulerAngles.y,
     transform.eulerAngles.z);
}

private void Update()
{
        
if (Input.GetMouseButton(1))
{
    //zoom
    curZoom += Input.GetAxis("Mouse ScrollWheel") * -zoomSpeed;
    curZoom = Mathf.Clamp(curZoom, minZoom, maxZoom);

    cam.transform.localPosition = Vector3.up * curZoom;


    if (Input.GetMouseButton(2))
    {
        float x = Input.GetAxis("Mouse X");
        float y = Input.GetAxis("Mouse Y");

        curXRot += -y * rotateSpeed;
        curXRot = Mathf.Clamp(curXRot, minXRot, maxXRot);
        transform.eulerAngles = new Vector3(curXRot, 
        transform.eulerAngles.y + (x * rotateSpeed), 0.0f);

    }

    if (Input.GetMouseButton(0))
    {
        Vector3 forward = cam.transform.forward;
        forward.y = 0.0f;
        forward.Normalize();

        Vector3 right = cam.transform.right;

        float moveX = Input.GetAxis("Mouse X");
        float moveZ = Input.GetAxis("Mouse Y");

        Vector3 dir = -forward * moveZ - right * moveX;
        dir.Normalize();

        dir *= moveSpeed * Time.deltaTime;

        transform.position += dir;
    }

}
_______________________________________________________________________
              

iPhone app
            preferences selection screen

Grid and camera

This gif shows how the camera can rotate around the grid and how tiles are created after posing the selected object (similar to Dorkromantik).

Managing selection

This prototype fully use the camera to be able to move an object composed of tiles above the large grid.
The goal is to create a mix between the tetris rotating element and a standard city builder.

iPhone app
              preferences selection screen