video
All graphics are built from squares and circles, from my shapes library. For example, the red X is just 3 rects: one for the background, one transformed to be skinny at at a 45° angle, and another at a -45° angle.
The code uses a more developed version of the code in the "_lib" folder of my planes demo.
A few examples of the kind of code I've been writing (untested):
// Using shapes for everything
atom/icon = 'shapes.dmi'
// WASD movement
entity/player
icon_state = "oval"
color = "navy"
step_size = 4
Login()
..()
var keyboard/k = new (client)
k.Axis("x", "d", "a")
k.Axis("y", "w", "s")
Update()
Slide(vec2_scale_to(client.keyboard.Check2D(), step_size))
..()
// Shooting
entity/player
var next_shot
var shoot_lag = 2
Update()
..()
if(client.mouse.down & MOUSE_LEFT)
if(world.time >= next_shot)
next_shot = world.time + shoot_lag
new /enity/bullet (src, client.mouse.Angle())
entity/bullet
icon_state = "oval"
color = "yellow"
bounds = "1,1"
bound_x = 16
bound_y = 16
var velocity[]
New(mob/Shooter, Angle)
SetCenter(Shooter)
velocity = vec2p(16, Angle)
Update()
Translate(velocity)
Bump()
del src
// Gun aiming
entity/player
var obj/gun/gun
New()
..()
gun = new (src)
Update()
..()
gun && gun.Update()
obj/gun
icon_state = "rect"
color = "black"
var angle
var entity/shooter
var matrix/shape = matrix(3/32, 0, 0, 0, 1, 0) // thin rectangle
New(Shooter)
transform = shape
shooter = Shooter
proc/Update()
var new_angle = shooter.client.mouse.Angle()
if(angle != new_angle)
angle = new_angle
shooter.overlays -= src
var matrix/mat = new (shape)
mat.Translate(0, 32)
mat.Turn(angle)
transform = mat
shooter.overlays += src
By taking advantage of my libraries, the game in the video was made in much less than an hour.
But even with all that, I can never get myself to stay on a single project for very long. Ugh.