Synopsis up to the last time
The number guessing game was completed successfully, and I got the essence of game production.
In response to the voice saying, "But ... there's something more ...", let's make a better game this time.
Challenge "Creating a" warehouse man ""
Let's make a game called "Warehouse Man" [^ 1]. The "warehouse man" is composed of the following rules.
--The screen consists of five objects: floor, wall, player, luggage, and switch.
--The screen is composed of vertical and horizontal two-dimensional planes.
--The screen must be surrounded by a wall.
--There is always one or more switches on the screen, and there are as many packages as there are switches.
--Players can move up, down, left and right on the floor.
--Players can also move over switches that have no luggage.
--When there is luggage in the player's direction of travel, the hero can push the luggage.
--Pushing a baggage means that the player moves to the place where the baggage was, and the baggage moves one step ahead in the direction of travel.
--If there is a wall or luggage at the destination of the luggage, the player cannot push the luggage.
--Luggage placed on the switch can be pushed again.
--Players cannot pull luggage.
-The game is cleared when all the luggage is placed on the switch.
Input / output
In this game, input / output is performed on the console as in the previous game. Think of inputting one character, processing according to the input, and displaying the result.
You can freely decide the input and output values. The following is an example of a rendering.
Input / output example
#########
#..p....#
#.o...*.#
#..*.oo.#
#..*....#
#########
COMMAND (w:up a:left s:down d:right)
->
symbol |
object |
. |
floor |
# |
wall |
p |
player |
o |
Baggage |
* |
switch |
Staged production
Finally move on to production. From here, only the process is shown, so please code it yourself.
Stage 1 Initial screen |
Create an appropriate screen with only the floor / wall and display it in text format. |
Stage 2 player |
Show the player on the screen. |
Stage 3 Player movement |
Accept user input and move the player up / down / left / right. |
Stage 4 Player movement check |
Move the player to the wall and see if it behaves as specified. |
Stage 5 luggage |
Display 3 pieces of luggage on the screen. |
Stage 6 Luggage movement |
Push each of the three packages by moving the player. |
Stage 7 Luggage movement check |
Push your luggage towards the wall and see if it behaves as specified. Also, what happens if you move it in the direction of another baggage? |
Stage 8 switch |
Add three switches. |
Stage 9 Switch and player |
Move the player over the switch. Also, move the player from the top of the switch. |
Stage 10 Switch and luggage |
Push your luggage over the switch. Also, push the luggage again after putting it on. |
Stage 11 Game clear |
Determine if there is luggage on all the switches. In that case, display "Game clear" and end the game. |
Stage 12 Usability improvement |
Allow users to see at a glance when players and luggage are on the switch. |
Commentary
Is it a little more like a game? I'm sure it would be more like that than a number guessing game.
What is the difference between the two games? I think it is in ** "Producer's Thoughts" ** and ** "Visuals" **.
In the number guessing game, the computer automatically determines the goals (numbers and numbers). On the other hand, on a screen like "Warehouse Man", the intention of the creator to "play like this" is hidden. This will ooze out as the game becomes more complex.
And I'm glad that I can see my actions. The game becomes fun as soon as you realize that you are running the game yourself.
Some people may be dissatisfied with the visuals without the brilliant graphics. But by the time the game is complete, implementing graphics is no longer that difficult. All you have to do is bring a brilliant graphic from somewhere and add the ability to display it instead of a symbol.
[^ 1]: As you can guess, it's a "that" game.