mardi 17 décembre 2019

Chasing game in C , robots and person

I am in my first year of uni (first semester) and this is my assignment for the programming class . I think its way harder than it should be , and i don't know where to start . I would appreciate any kind of advice , guides , examples . I have 20 days to finish this of . Some first questions i have : -How can i put things in random places (that are currently free in the board ). -Pdcurses will let me refresh the monitor in real-time ? How should i approach such a thing? -What is the thought process for the cumputer to know where the person is and to move all the robots towards it? I am not looking for a solution , i am trying to get help . Thank you .

The game is played in a board 60x20 , virtual squares that they don't separate with some indication (vertical lines etc.). In the beginning of every level , there are : a person [M] that is controlled by the player through the keyboard and the enemy robots[R] , which are controlled by the computer , chasing the person.The goal is to finish as many levels as possible . A level is finished when all robots have been destroyed . The person [M] has one life only .

In the beginning of every level the person and robots are placed in random free spots . The person and robots are moving alternatively .First move is for the player , and then the computer that moves all of its robots at the same time . When a robot moves in the same spot with the person , the game ends . The robots are moved in the next square(vertically , horizontally , diagonally) , trying to reduced their distance from the person , vertically and horizontally . If two robots move in the same square , they are killed, leaving a pile behind [#] .A robot can be also killed if it steps in a pile . The robots cant see the piles , they cant avoid them . In every round the player can : -Move the person in all direction with arrow keys and keys home, end , page up and page down (for the diagonal moves).Every move that are off the limits of the game or that is on a square with piles or robot are ignored. -Use a bomb . In the beginning of every level the player gains a bomb . If the bomb is not used , it is transferred to the next level. Player can use the bomb with the key 'B' . A bomb clear all the squares near the person from robots and piles . -Teleport in a random free spot with the key 'T' . -With key 'space' or '5' to pass its turn . -To finish the game with key 'Q' .

The player shouldn't use the key 'Enter' to enter a command . The screen will refresh and not reload . The library pdcurses is recommended . Cant use goto or break commands .




Aucun commentaire:

Enregistrer un commentaire