1988 · Elite Systems

Ikari Warriors: gameplay

This minisite was contributed by unorig. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/ikari-warriors with me to Gold.

How the road moves, what fire does when tapped and when held, and what each token, tank, and mine does, read from the game's code.

01 · The road

The screen moves only when you do

The road scrolls up one pixel a frame while every living player is in the top four fifths of the screen, above raster line 188 ($BC, checked in lower_panel_irq). Hang back near the bottom and the scrolling stops.

The soldiers come from a list of 369 entries at route_list, each a position along the road and the group of soldiers that appears there. spawn_from_route starts a group only once the scroll has passed its position, so while nobody moves forward, no new soldiers arrive. The same list places the mines, and a list of twelve at tank_list places the empty tanks.

The road itself is drawn from a script of 1,891 rows, which the Maps page runs from start to finish.

02 · Fire

Tap to shoot, hold to throw

player_fire reads the fire button every second frame. The moment it goes down, a bullet leaves at once, one of the 99 in the panel. Keep holding, and at the ninth count, eighteen frames after the press, a player on foot throws a grenade. The same long hold does two other jobs: beside an empty tank it climbs in, and inside a tank it climbs out.

A hold of 16 frames fires one bullet only; holds of 20 and 30 frames fire a bullet and throw a grenade.6 A grenade flies a set distance for the way you face, from the table at grenade_range, and goes off where it lands. A wall stops a grenade, which falls where it meets it, unless the cyan token lets shots through; a grenade thrown with that token kills the first soldier it meets outright and flies on (update_grenade_hits). The test reads player one's token for both players, a slip in the code.

03 · Two players

Your partner's bullets hit you too

In a two-player game every bullet is tested against both players, and only the one who fired it is spared (update_bullet_hits). A grenade's blast kills every player on foot inside it except the one who threw it (blast_hits). Two players have to keep out of each other's line of fire.

04 · Tokens

Seven tokens, given in turn

Every fourth soldier spawn_from_route starts carries a token. Which one comes next is fixed: the list at item_cycle hands them out in the same order every game. A carrier you kill drops its token where it falls (drop_item), and walking over it calls pick_up_item.

OrderTokenWhat it does

Each token's colour comes from item_colours, and the swatches here are those colours. A token is drawn in multicolour, so only the low three bits of each colour show. The C64-Wiki lists the same colours.2 Every power-up is taken away when you lose a life (init_player).

An eighth token hides in pick_up_item: a purple one worth 800 points that the list never hands out. Discoveries has the details.

05 · Tanks

Tanks: proof against bullets, not against grenades

Twelve empty tanks wait along the road, each with a flashing IN above it. Hold fire beside one to climb in. A player in a tank cannot be hit by bullets (update_bullet_hits), runs soldiers over for 100 points each (check_trampling), and fires shells instead of bullets: a shell flies like a grenade and blows up where it lands, so it destroys what bullets cannot. Water stops a tank (move_player).

Fuel drains every six frames (update_fuel). When it runs out, or when a grenade hits the tank, a countdown of 100 frames starts, two seconds with a warning sound, and then the tank blows up with whoever is inside. Hold fire to climb out in time. A black token fills the tank again.

06 · Mines

Mines that show themselves just in time

A mine is invisible. update_mines looks at each one every eight frames, and when a player comes within 16 pixels across and 32 down it appears, flashing between the two colours at mine_flash_colours and beeping. The mine goes off when a player is within 5 pixels across and 12 down, so there is just time to step around it.

07 · Water

Water

A character whose colour has a low nibble of $E is water (char_colours). A player on foot with both feet in it is slowed every second frame (move_player). A tank cannot enter it at all. A soldier in water dives under, drawn with frame $6F, and bullets pass over him (update_bullet_hits).

08 · Enemies

Soldiers, guns and helicopters

One bullet kills a soldier, for 100 points. A player on foot who walks into a soldier dies (check_trampling); a player in a tank runs him over. A soldier in water dives under it, and a bullet passes over him. Enemy tanks and other vehicles, and the helicopters, ignore bullets: only a grenade's blast, or a shell's, destroys them (blast_hits).

The guns along the road come in two kinds (update_guns). A turret, drawn in characters, turns to face the nearer player below it, left, down, or right, redrawing its barrel in the character set as it turns (turret_left_gfx, turret_right_gfx), and fires single bullets. A mortar pit checks every 30 frames for a player below it, within 90 pixels, and fires three shells in a spread. A helicopter flies down the screen when the road's script calls for one (map_special), and is worth 1,000 points brought down.

09 · Score

Points and extra lives

The score is kept in hundreds of points, in decimal digits (add_score). Each player starts with five lives, and the same routine gives an extra one at 20,000 points, at 50,000, and at every 50,000 after that.

ForPoints
A soldier shot, blown up or run over100
A token picked up200
A helicopter brought down1,000
Breakable scenerywhat its entry in the road's script gives
Reaching the end of the road, with lives left100,000

A player who loses a life comes back at the bottom of the screen, in the nearest column where the ground is clear (respawn_players).

10 · The end

The end of the road

Twelve rows before the road ends, its script puts eight figures on the screen (ending_setup). At the last row it hands over to route_finished, which gives each player with lives left 100,000 points, in twenty steps of 5,000, and prints the message at ending_text: "Congratulations, you have rescved Colonel Cook and received 100,000 pts. Continue to fight hard and bring freedom to the people you protect." The spelling is the game's own (Discoveries).

A top-ten score at the end of a game is entered in the high-score table with a name of nine letters (enter_high_score).