Skip to content

FeelHippo/TankWars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEMO

Update, I have improved the navigation of the tank, it does not hit the walls now: The survival of the tankest

Arena

Rectangular

Size: 1340x1000

Origin (0,0): lower-left corner

0 degrees: left, 90 degrees: up

Tank is subject to inertia

Only turns if speed <= 50 km/h

Controls

await tank.drive(angle, speed)

angle: direction 0-359

speed: 0-100

####get position:

await tank.getX(); 
await tank.getX()

to turn, first decrease speed to 50 km/h

get current speed:

await tank.getSpeed()

missiles can be fired in any direction

max 2 missiles in airspace at any given time

distance max 700 meters

can be programmed to explode mid-aid

shoot missile:

await tank.shoot(angle, range)

tank's shield is 100, if shield < 0 it will be destroyed

damage: missile explosion, hits arena's wall, hits other tank

check shield status, returns amount of damage inflicted:

await tank.getDamage();

damage left: 100 - getDamage()

radar is directional, max width +-10 degrees

read radar:

await tank.scan(angle, resolution)

angle: direction 0-359

resolution: 1-10 (degrees)

returns the distance to the nearest enemy tank

no tanks in sight, returns 0

About

This was a lot of fun!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published