Generic Strategy Game

by ian05
See Code Download Embed
Player 1 controls the red, and Player 2 controls the blue. Each player clicks on provinecs they control to manage them. If the player does not control the province they cannot use it.

The P1 variable shows what resources player 1 has, and the P2 variable shows what resources player 2 has. The resources are shown in this order:

# of Food
# of Oil
# of Metal
# of Weapons


The turn variable shows who's turn it is. If turn is 1, then it is player 1's turn. If turn is 2, then it is player 2's turn. Press the next turn button to end the turn of the current player and start the next turn.

--------------------------------------------------

When you click a resource province, you will be asked if you want to build an industry, which requires the following materials to produce:

2 Food
2 Oil
2 Metal
0 Weapons

If constructed, it will increase resource production by +1. You can construct 2 industry per resource province.

--------------------------------------------------

When you click a city, you will be asked what you would like to build. You can build the following things: 

Barracks (type b to make this)
1 Food
0 Oil
1 Metal
0 Weapons

Tank Factory (type tf to make this)
1 Food
1 Oil
1 Metal
0 Weapons

Weapons Factory (type wf to make this)
1 Food
0 Oil
1 Metal
0 Weapons

If you have a Weapons factory, you can also produce 2 Weapons:

Build 2 Weapons (type wp to make this)
1 Food
0 Oil
1 Metal
0 Weapons

If you type unit when asked what you would like to build, you will be asked what kind of troop you would like to make. Your options are as follows:

Infantry: (after typing unit type i)
1 Food
0 Oil
0 Metal
1 Weapons
Requires Barracks to make

Light Tank: (after typing unit type lt)
1 Food
1 Oil
1 Metal
1 Weapons
Requires Tank Factory to make

Anti Tank: (after typing unit type at)
1 Food
0 Oil
1 Metal
1 Weapons
Requires Weapons Factory to make

--------------------------------------------------

When you have produced a troop, move your mouse pointer over it, press space, and while holding down space press one of the following keys to move the troop:

w - up
a - up + left
z - down + left
x - down
d - down + right
e - up + right

When 2 enemy troops (red and blue troops) are close to each other, and one initiates an attack, check the table here and press 0 on the defeated troop to delete it.

Infantry defeats Anti Tank
Anti Tank defeats Light Tank
Light Tank defeats Infantry

If a troop reaches enemy territory, the troop steals control of the territory and the other player gains control of it.

If 2 enemy troops are in the same territory then it switches back and forth between them.

--------------------------------------------------

Created May 8, 2022

Last updated May 27, 2022

Published May 27, 2022