pddring / cpu-battle-tank Goto Github PK
View Code? Open in Web Editor NEWLittle Man Computer Battle Tank Game
Little Man Computer Battle Tank Game
The LMC CPU should simulate the fetch-execute cycle in order to simulate all of the possible instructions.
See http://en.wikipedia.org/wiki/Little_man_computer for details of the instruction set
Hello,
I think driving on an ITEM_TYPE_AMMO doesn't actually top up the ammo.
I suggest adding :
if (task[2] == bt.ITEM_TYPE_AMMO) {
// top up ammo
var tank = bt.getTankByCoordinates(x, y);
if(tank) {
tank.ammo += 10;
if(tank.ammo > tank.maxAmmo)
tank.ammo = tank.maxAmmo;
}
}
after line 234 (batlletanks.js)
The user should be able to edit the contents of LMC ram at each of the 99 addresses.
I've made an animated fuel can in blender in order to create a 64x64px animated gif for the game grid.
We need the same type of thing for:
There should be some simple levels to test moving, shooting and collecting objects.
The existing LMC instruction set allows for input and output but we need to extend that to allow the tank to move and fire with input and output controls. At the moment the 9xx instructions concern I/O so we could extend them in order to:
Output:
move forwards / backwards
turn left / right
aim left / right
fire
send radio broadcast (to other tanks)
Input:
Detect obstacles
Detect enemy tanks
receive radio broadcast (from other tanks)
The contents of the LMC RAM should be interpreted in such a way that the mnemonics for each instruction is displayed with an explanation of what it does.
We need to make it so that the game stores a series of mission objectives for each level that can be automatically detected when they've been completed.
E.g.
Currently, tanks just fire straight through obstacles. They need to be fixed so that you can't fire through an obstacle and tanks / straw / fuel should blow up if hit by the laser.
It'd be good to be able to change which tank details appear in the game UI:
The LMC CPU has 99 mailboxes that work as RAM. Ideally, each tank will have a LMC CPU that can be used to control it. We need to start simulating the CPU for each tank
Rather than having to check the objectives popup, it'd be useful if there was some form of visual confirmation when a mission task was completed.
The LMC has an accumulator, program counter and instruction register. These store numbers from -999 to 999 (LMC is denary rather than binary)
Hi again,
I think also that when we ask the INPUT of TankDir, the answer is either 0-1-2-3, and not 0-2-4-6.
So I think line 1091 should be modified :
description: 'Store current tank direction in accumulator register
Accumulator | Meaning |
---|---|
0 | North |
1 | East |
2 | South |
3 | West |
(I hope I've understood the code well and I'm not wrong !...)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.