Skip to content

Graphics ~ Design document for integrating split screen graphics with chiventure

Borja Sotomayor edited this page May 15, 2021 · 3 revisions

Introduction

We want to be able to integrate split screen with chiventure so that it will display a graphic that corresponds to the room the player moves into. For example, if the player moves into room 1, we want to display an image of room 1 as the split screen graphic.

Details and Implementation

In draw_images.h there will be functions to create the graphics for the split screen. It will make use of raylib.h to load images. We assume the game developers would provide the correct path for their images and have their room images be labeled room{{room-id}}.png For the next sprint we will be implementing the draw_room function and updating the ui.c file. We will be looking at the cli files and ui files to decide how to efficiently implement calling the draw_room function. Right now, ui.c only calls print_banner to display the chiventure banner. An idea we have is in the game while loop of start_ui function, using the context struct we can see which room the player is in and call the draw_room function based on that. This would happen continuously as it is in the game while loop. However, if there is a more efficient way by connecting cli to ui then we will implement it that way.

draw_images.h design

#ifndef DRAW_IMAGES_H #define DRAW_IMAGES_H

#include "common/ctx.h" #include "ui/ui_ctx.h"

/* draw_room

  • Draws a room based on its room number for the split screen in chiventure
  • Parameters:
    • room_number: integer that defines the room
  • No value is returned */ void draw_room(int room_number);

/* draw_object

  • Draws an object based on its item ID
  • Parameters:
    • item_id: a string that defines each item
  • No value is returned */ void draw_object(char *item_id);

#endif

Next Step

In future sprints we would like to also implement a draw_object function such that if the player picks up an item/object, we would display that object in the graphic.

Clone this wiki locally