bitsy.nv
· 3.1 KiB · Text
Originalformat
Playground
|:break: :break:| :: break
|| :current room: test
:screen resolution: 64 64
|:: draw current room :current room: $room?|
:tile location: 0 0
:: get tiles for $room
:: draw room
|:: draw room :room data: ($1 $2 $3 $4 $5 $6 $7 $8)|
:: draw sprite $1 :: next tile column
:: draw sprite $2 :: next tile column
:: draw sprite $3 :: next tile column
:: draw sprite $4 :: next tile column
:: draw sprite $5 :: next tile column
:: draw sprite $6 :: next tile column
:: draw sprite $7 :: next tile column
:: draw sprite $8 :: next tile row
:: draw room
|:: draw room :tile location: $x $y|
|:: draw sprite $1 :tile location: $x $y?|
:pixel location: $x $y
:: get sprite 1 for $1
:: draw sprite
|:: draw sprite :sprite data: ($1 $2 $3 $4 $5 $6 $7 $8)|
:: plot $1 :: next pixel column
:: plot $2 :: next pixel column
:: plot $3 :: next pixel column
:: plot $4 :: next pixel column
:: plot $5 :: next pixel column
:: plot $6 :: next pixel column
:: plot $7 :: next pixel column
:: plot $8 :: next pixel row
:: draw sprite
|:: draw sprite :pixel location: $x $y|
|:: plot . :pixel location: $x $y?|
:@graphics: set-pixel $x $y 0 0 0
|:: plot # :pixel location: $x $y?|
:@graphics: set-pixel $x $y 255 255 255
|:: next pixel column :@math: $x :pixel location: $_ $y|
:pixel location: $x $y
|:: next pixel column? :pixel location: $x $y?|
:@math: add $x 1
|:: next pixel row :@math: $y :pixel location: $_x $_y :tile location: $x $_?|
:pixel location: $x $y
|:: next pixel row? :pixel location: $x $y?|
:@math: add $y 1
|:: next tile column :@math: $x :tile location: $_ $y|
:tile location: $x $y
|:: next tile column? :tile location: $x $y?|
:@math: add $x 8
|:: next tile row :@math: $y :tile location: $x $_|
:tile location: 0 $y
|:: next tile row? :tile location: $x $y?|
:@math: add $y 8
|::draw|
:: clear the screen
:: draw current room
|:: get sprite 1 for .|
:sprite data: (
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
)
|:: get sprite 1 for p|
:sprite data: (
. # . # # # # .
. # # # # # . .
. . . . . . . .
. . # # # # . .
. # . # # . # .
. . # . . # . .
. . # . . # . .
)
|:: get sprite 1 for c|
:sprite data: (
. . . . . . . .
. . . . . . . .
. . . . # . # .
. . . . # # # .
# . . . # # # .
# . # # # # . .
. # # # # # . .
. . # # . # . .
)
|:: get sprite 1 for w|
:sprite data: (
# # # # # # # #
# # . . . . # #
# . # # # # . #
# . # . . # . #
# . # . . # . #
# . # # # # . #
# # . . . . # #
# # # # # # # #
)
|:: get tiles for test|
:room data: (
w w w w w w w w
w . . . . . . w
w . . . . . . w
w . c . . p . w
w . . . . . . w
w . . . . . . w
w . . . . . . w
w w w w w w w w
)
| 1 | |:break: :break:| :: break |
| 2 | |
| 3 | || :current room: test |
| 4 | :screen resolution: 64 64 |
| 5 | |
| 6 | |:: draw current room :current room: $room?| |
| 7 | :tile location: 0 0 |
| 8 | :: get tiles for $room |
| 9 | :: draw room |
| 10 | |
| 11 | |:: draw room :room data: ($1 $2 $3 $4 $5 $6 $7 $8)| |
| 12 | :: draw sprite $1 :: next tile column |
| 13 | :: draw sprite $2 :: next tile column |
| 14 | :: draw sprite $3 :: next tile column |
| 15 | :: draw sprite $4 :: next tile column |
| 16 | :: draw sprite $5 :: next tile column |
| 17 | :: draw sprite $6 :: next tile column |
| 18 | :: draw sprite $7 :: next tile column |
| 19 | :: draw sprite $8 :: next tile row |
| 20 | :: draw room |
| 21 | |:: draw room :tile location: $x $y| |
| 22 | |
| 23 | |:: draw sprite $1 :tile location: $x $y?| |
| 24 | :pixel location: $x $y |
| 25 | :: get sprite 1 for $1 |
| 26 | :: draw sprite |
| 27 | |
| 28 | |:: draw sprite :sprite data: ($1 $2 $3 $4 $5 $6 $7 $8)| |
| 29 | :: plot $1 :: next pixel column |
| 30 | :: plot $2 :: next pixel column |
| 31 | :: plot $3 :: next pixel column |
| 32 | :: plot $4 :: next pixel column |
| 33 | :: plot $5 :: next pixel column |
| 34 | :: plot $6 :: next pixel column |
| 35 | :: plot $7 :: next pixel column |
| 36 | :: plot $8 :: next pixel row |
| 37 | :: draw sprite |
| 38 | |:: draw sprite :pixel location: $x $y| |
| 39 | |
| 40 | |:: plot . :pixel location: $x $y?| |
| 41 | :@graphics: set-pixel $x $y 0 0 0 |
| 42 | |
| 43 | |:: plot # :pixel location: $x $y?| |
| 44 | :@graphics: set-pixel $x $y 255 255 255 |
| 45 | |
| 46 | |
| 47 | |:: next pixel column :@math: $x :pixel location: $_ $y| |
| 48 | :pixel location: $x $y |
| 49 | |
| 50 | |:: next pixel column? :pixel location: $x $y?| |
| 51 | :@math: add $x 1 |
| 52 | |
| 53 | |:: next pixel row :@math: $y :pixel location: $_x $_y :tile location: $x $_?| |
| 54 | :pixel location: $x $y |
| 55 | |
| 56 | |:: next pixel row? :pixel location: $x $y?| |
| 57 | :@math: add $y 1 |
| 58 | |
| 59 | |
| 60 | |:: next tile column :@math: $x :tile location: $_ $y| |
| 61 | :tile location: $x $y |
| 62 | |
| 63 | |:: next tile column? :tile location: $x $y?| |
| 64 | :@math: add $x 8 |
| 65 | |
| 66 | |:: next tile row :@math: $y :tile location: $x $_| |
| 67 | :tile location: 0 $y |
| 68 | |
| 69 | |:: next tile row? :tile location: $x $y?| |
| 70 | :@math: add $y 8 |
| 71 | |
| 72 | |
| 73 | |::draw| |
| 74 | :: clear the screen |
| 75 | :: draw current room |
| 76 | |
| 77 | |:: get sprite 1 for .| |
| 78 | :sprite data: ( |
| 79 | . . . . . . . . |
| 80 | . . . . . . . . |
| 81 | . . . . . . . . |
| 82 | . . . . . . . . |
| 83 | . . . . . . . . |
| 84 | . . . . . . . . |
| 85 | . . . . . . . . |
| 86 | . . . . . . . . |
| 87 | ) |
| 88 | |
| 89 | |:: get sprite 1 for p| |
| 90 | :sprite data: ( |
| 91 | . # . # # # # . |
| 92 | . # # # # # . . |
| 93 | . . . . . . . . |
| 94 | . . # # # # . . |
| 95 | . # . # # . # . |
| 96 | . . # . . # . . |
| 97 | . . # . . # . . |
| 98 | ) |
| 99 | |
| 100 | |:: get sprite 1 for c| |
| 101 | :sprite data: ( |
| 102 | . . . . . . . . |
| 103 | . . . . . . . . |
| 104 | . . . . # . # . |
| 105 | . . . . # # # . |
| 106 | # . . . # # # . |
| 107 | # . # # # # . . |
| 108 | . # # # # # . . |
| 109 | . . # # . # . . |
| 110 | ) |
| 111 | |
| 112 | |:: get sprite 1 for w| |
| 113 | :sprite data: ( |
| 114 | # # # # # # # # |
| 115 | # # . . . . # # |
| 116 | # . # # # # . # |
| 117 | # . # . . # . # |
| 118 | # . # . . # . # |
| 119 | # . # # # # . # |
| 120 | # # . . . . # # |
| 121 | # # # # # # # # |
| 122 | ) |
| 123 | |
| 124 | |
| 125 | |:: get tiles for test| |
| 126 | :room data: ( |
| 127 | w w w w w w w w |
| 128 | w . . . . . . w |
| 129 | w . . . . . . w |
| 130 | w . c . . p . w |
| 131 | w . . . . . . w |
| 132 | w . . . . . . w |
| 133 | w . . . . . . w |
| 134 | w w w w w w w w |
| 135 | ) |