Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Post Code

Name: Anonymous 2011-03-04 21:33

One recurring complaint is that nobody talks about code on /prog/. So everyone write go and write some code, any code, that does something, anything, and post it. A small explanation wouldn't go amiss either.

Name: Anonymous 2011-03-21 22:37


loadUnit path
 -> type:(split \/ path).rhd.asStr
 -> u:("$path/unit.txt".fget |> map ?.asChr.{\Newline->\Space; x->x} |> parseST
       |> map [_ a b]~>[a.asStr b.eval] |> sort by=lhd)
 -> s:("$path/gfxes/".ls |> map (drop fullPrefix.len+1 ?)
       |> map x~>[(split \. x.asFilename).lhd x] |> sort by=lhd
       |> bmap (loadUnitFrames u."building".{ye?->1; _->5} ?))
 -> !s."default" |> (_ [5++dummyGfx])
 -> for [t _] in tilesets s.t.{no? -> s.t=:s."default"}
 -> [@!u "type"=type "gfxes"=(bdel "default" s) "layer"=tileMasks.(u."layer")
         "frame"=0 "wounds"=0]
 -> u."moveMask"=:(fnd [c@_]~>u.c moveClasses|>?,1 |>map tileMasks.? |> [0@?] |> fold or)
 -> !u."hp"     |> (_ 1)
 -> !u."size"   |> (_ [1 1])
 -> !u."selSize"|> (_ u."size"*32)
 -> !u."sight"  |> (_ 0)
 -> !u."attack" |> (_ "melee")
 -> for dir in (ls "$dataPrefix/units/$(u."type")/sounds/")
      u."sounds".(split \/ dir |> ?.rtl.rhd) =: dir.ls
 -> !u."sounds"."selected" |> (_ ["$dataPrefix/sounds/ui/click.wav"])
 -> u."building".{ye?
     -> u."sounds"."dead" =: "$dataPrefix/sounds/misc/wreckage/".ls}
 -> [type=u @!unitTypes]

Name: Anonymous 2011-03-21 22:40

>>244

layer=2 land=ye corpse="orc_corpse" attack="sword"
hp=60 damage=6 range=1 armor=2 speed=10 sight=4 organic=ye
cost=["gold"=600 "time"=60]
anims=["still"=[@stillAnim 'rotate]
       "move"='((0 2 3) (5 1 3) (5 2 3) (10 1 2) (10 1 3) (0 1 2)
                (0 2 3) (15 1 3) (15 2 3) (20 1 2) (20 1 3) (0 1 2))
       "death"='((45 3) (50 3) (55 100))
       "attack"='((25 3) (30 3) (35 3) attack (40 5) (0 10))]

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List