smackem / jobotwar Goto Github PK
View Code? Open in Web Editor NEWA RobotWar clone using JavaFX, REST and Blazor WebAssembly
License: MIT License
A RobotWar clone using JavaFX, REST and Blazor WebAssembly
License: MIT License
Extend JSON format with meta information like version and source code language.
one module jobotwar-model and one module jobotwar-gui
Fix FileChooser usage
In the EditController, make sure that robot names are unique. This is a must for the GameRecorder, which should assert on the condition.
add sign, min and max
LD_F64 123
for def x = 123
)RET
in state if last stmt was not RET
use smaller ParticleExplosion with hues 0 to 30 (or robot hue) for robot explosions
get distance from current position to destination:
hypot(@x() - destX, @y() - destY)
this is a less verbose alternative to sqrt(dx * dx + dy * dy)
get angle to destination:
atan2(@x() - destX, @y() - destY)
this is a less verbose alternative to atan(dy / dx); // add 180 if dy < 0
select icon from list for robot on creation (editcontroller). display icon in robot circle.
New V2 programs should contain
state main() {
// your code here
}
also, the error should be reported
State-based language:
def aim
state main() {
yield scan(@damage(), 0)
}
state scan(damage, radarAngle) {
distance := @radar(radarAngle)
if distance < 0 {
@fire(radarAngle, abs(distance))
}
radarAngle = radarAngle + 7
if @damage() != damage {
yield newDest
}
}
state newDest() {
destX = @random(10, 100)
destY = @random(10, 200)
@speedX(destX - @x)
@speedY(destY - @y)
yield move(destX, destY)
}
state move(destX, destY) {
arrivedX := false
arrivedY := false
if abs(destX - @x) < 30 {
@speedX(0)
arrivedX = true
}
if abs(destY - @y) < 30 {
@speedY(0)
arrivedY = true
}
if arrivedX and arrivedY {
yield main
}
}
function xFromAngle(angle, length) -> @x() + cos(angle) * length
function yFromAngle(angle, length) {
return @y() + sin(angle) * length
}
v2 may be a multiplayer game:
messages logged through the OUT register should be displayed in the emitting robot's color
something like 64 should be ok
Catch exception when ticking a robot, write message to log window, stop program.
Log events like "robot X got killed" and robot's log messages.
Also record random numbers to enable #11.
sqrt(100, 100)
works :$ - fix it
Mix V1 and V2 robots
use OUT register for statement
@log(@speedX())
Show a nice animation when a game is over
new color should have a certain minimum distance from all other robot colors
Example:
Robot X was destroyed by Robot Y
Robot X was destroyed
When all robots have been killed in one tick, mark the match as draw.
when running a simulation, show a progress bar in the "running"-overlay
add simulation mode:
as soon as the board is ready:
instead of just starting the game with the ticker, simulation calculates the outcome as quickly as possible, not restrained to ticks. if no winner can be determined, simulation ends after a few million cycles.
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.