-
Notifications
You must be signed in to change notification settings - Fork 0
/
roadtxtr.wren
2250 lines (2082 loc) · 146 KB
/
roadtxtr.wren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// title: ROAD TXTR
// author: unicorns of DEATH
// desc: avoid pedestrians and respond to texts
// site: tbd
// license: MIT License
// version: 0.1
// script: wren
import "random" for Random
var WIDTH=240
var HEIGHT=136
var MAP_W=30
var MAP_H=17
var COLOR_BG=8
var MUSSPLASH=0
var MUSGAME=1
var MUSTITLE=2
var MUSDEATH=3
var MUSWIN=4
var MUSTEMPO=100
var MUSSPD=3
var FPS=60
var MUSBEATTICKS=FPS*60/MUSTEMPO*MUSSPD/6
var SFXNEXT=1
var SFXHIT=3
var SFXSCREAM=4
var SFXGRASS=5
var SFXRIGHT=6
var SFXWRONG=7
var SFXTXT=8
var SFXEXPLODE=9
var SFXBORK=10
var PLAYER_DX=10
var TXT_X=120
var TXT_Y=10
var TXT_W=WIDTH-TXT_X-10
var TXT_H=HEIGHT-TXT_Y
var EVENT_TICK=600
var WIN_X=12900
var CROSSING_GAP=200
var STRESS_TICK=120
var SHAKING_TICK=30
var RANDOM=Random.new()
var DEBUG_HITBOX=false
var ENABLE_PHONE=true
var ENABLE_COLLISIONS=true
var AUTO_DRIVE=false
var SHOW_DOG=false
var XING_X=7980
var XING_TICKS=720
var DUCK_SPRITE=268
var DUCKLING_SPRITE=302
var XING_LINGS=12
var XING_BORK_TICKS=[4455,4500,4555,4600]
// VRAM ADDRESSES
var MOUSE_CURSOR=0x3FFB
var PALETTE_MAP=0x3FF0
// BUTTONS
var BTN_UP=0
var BTN_DOWN=1
var BTN_LEFT=2
var BTN_RIGHT=3
var BTN_A=4
var BTN_B=5
var BTN_X=6
var BTN_Y=7
var CHEAT_CODE=[BTN_UP,BTN_UP,BTN_DOWN,BTN_DOWN,BTN_LEFT,BTN_RIGHT,BTN_LEFT,BTN_RIGHT,BTN_B,BTN_A]
// SPRITES
var PEDESTRIAN_SPRITES=[256,258,260,262,264,266,268,270]
var PEDESTRIAN_SPEEDS={
256:0.25,
258:0.2,
260:0.15,
262:0.3,
264:0.4,
266:0.5,
268:0.2,
270:0.3,
302:0.2
}
// TILE IDs
var TILE_SIZE=8
var TILE_SIZE_2=16
var ROAD_TILES=[0,1,2,3,16,17,18,19,32,33,48,49]
var GRASS_TILES=[64,65,80,81]
var FOOTPATH_TILES=[66,67,82,83,98,99,114,115]
var FOOTPATH_DOWN=[68,69,84,85]
var FOOTPATH_UP=[100,101,116,117]
var CROSSING_TILES=[34,35,50,51]
var GOOD_TEXT=0
var BAD_TEXT=0
var PEDESTRIANS_KILLED=[]
class ChunkyFont {
static init_() {
__SYM_MAP={
"}":0,
"{":1,
"^":2,
"<":3,
"=":4,
">":5,
"]":6,
"[":7,
"r":16,
"?":17,
"|":18,
"Y":19,
"o":20,
"T":21,
"P":22,
"7":23,
"6":32,
"j":33,
"v":34,
"m":35,
"_":37,
"L":38,
"J":39,
}
__WIDTH=8
__HEIGHT=8
__COLOR1=10
__COLOR2=9
__LETTERS={
"a":[
"",
"r?",
"6v"
],
"b":[
"^",
"]?",
"Lj"
],
"c":[
"",
"r>",
"6>"
],
"d":[
" ^",
"r[",
"6J"
],
"e":[
"",
"r?",
"6>"
],
"f":[
"r>",
"]>",
"v"
],
"g":[
"",
"r7",
"6[",
"<j"
],
"h":[
"^",
"]?",
"vv"
],
"i":[
"o",
"^",
"v"
],
"j":[
" o",
" ^",
" |",
"<j"
],
"k":[
"^",
"]>",
"vo"
],
"l":[
"^",
"|",
"v"
],
"m":[
"",
"PT?",
"vvv"
],
"n":[
"",
"P?",
"vv"
],
"o":[
"",
"r?",
"6j"
],
"p":[
"",
"P?",
"]j",
"v"
],
"q":[
"",
"r7",
"6[",
" v"
],
"r":[
"",
"P>",
"v"
],
"s":[
"",
"r>",
"<j"
],
"t":[
"^",
"]>",
"6>"
],
"u":[
"",
"^^",
"6J"
],
"v":[
"",
"^^",
"Lj"
],
"w":[
"",
"^^^",
"6mj"
],
"x":[
"",
"oo",
"oo"
],
"y":[
"",
"^^",
"6[",
"<j"
],
"z":[
"",
"<?",
"6>"
],
"A":[
"r=?",
"]=[",
"v v"
],
"B":[
"P=?",
"]={",
"L=j"
],
"C":[
"r=>",
"|",
"6=>"
],
"D":[
"P=?",
"| |",
"L=j"
],
"E":[
"P=>",
"]=>",
"L=>"
],
"F":[
"P=>",
"]>",
"v"
],
"G":[
"r=>",
"|<7",
"6=J"
],
"H":[
"^ ^",
"]=[",
"v v"
],
"I":[
"T",
"|",
"_"
],
"J":[
" ^",
"^ |",
"6=j"
],
"K":[
"^ ^",
"]={",
"v v"
],
"L":[
"^",
"|",
"L=>"
],
"M":[
"PY7",
"|v|",
"v v"
],
"N":[
"P?^",
"|||",
"v6J"
],
"O":[
"r=?",
"| |",
"6=j"
],
"P":[
"P=?",
"]=j",
"v"
],
"Q":[
"r=?",
"| |",
"6=o"
],
"R":[
"P=?",
"]={",
"v v"
],
"S":[
"r=>",
"6=?",
"<=j"
],
"T":[
"<T>",
" |",
" v"
],
"U":[
"^ ^",
"| |",
"6=j"
],
"V":[
"^ ^",
"|rj",
"Lj"
],
"W":[
"^ ^",
"|^|",
"6mj"
],
"X":[
"o o",
" o",
"o o"
],
"Y":[
"^ ^",
"6Yj",
" v"
],
"Z":[
"<=7",
"r=j",
"L=>"
]
}
__WIDTHADJ={
"j":-1
}
}
construct new(x,y) {
_x=x
_y=y
}
ch(c) {
var xadj=__WIDTHADJ[c]
if (xadj==null) {
xadj=0
}
var width=0
var y=_y
for (row in __LETTERS[c]) {
var x=_x+xadj*__WIDTH
var rowwidth=0
var hasletter=false
for (i in 0...row.count) {
var letter=row[i]
if (letter!=" ") {
hasletter=true
TIC.spr(__SYM_MAP[letter]+128,x,y,0)
}
if (hasletter) {
rowwidth=rowwidth+1
}
x=x+__WIDTH
}
y=y+__HEIGHT
width=width.max(rowwidth)
}
_x=_x+(width+xadj)*__WIDTH
}
s(s) {
var x=_x
var readcolor=0
for (i in 0...s.count) {
var c=s[i]
if (c=="\n") {
_x=x
_y=_y+__HEIGHT*4
} else if (c=="^") {
readcolor=1
resetpalette()
} else if (readcolor==1) {
var color=tonumberfromhex(c)
TIC.poke4(PALETTE_MAP * 2 + __COLOR1, color)
readcolor=2
} else if (readcolor==2) {
var color=tonumberfromhex(c)
TIC.poke4(PALETTE_MAP * 2 + __COLOR2, color)
readcolor=0
} else {
ch(c)
}
}
resetpalette()
}
tonumberfromhex(c) {
if (c=="a") {
return 0xa
} else if (c=="b") {
return 0xb
} else if (c=="c") {
return 0xc
} else if (c=="d") {
return 0xd
} else if (c=="e") {
return 0xe
} else if (c=="f") {
return 0xf
} else {
return Num.fromString(c)
}
}
resetpalette() {
TIC.poke4(PALETTE_MAP * 2 + __COLOR1, __COLOR1)
TIC.poke4(PALETTE_MAP * 2 + __COLOR2, __COLOR2)
}
}
ChunkyFont.init_()
class State {
construct new() {
_tt=0
_nextstate=this
}
nextstate { _nextstate }
nextstate=(value) {
_nextstate=value
}
tt { _tt }
tt=(value) {
_tt=value
}
reset() {
_tt=0
}
update() {
_tt=_tt+1
}
finish() {
return
}
next() {
return this
}
draw() {
return
}
}
class SkipState is State {
construct new(grace) {
super()
_grace=grace
}
finish() {
TIC.sfx(-1)
TIC.sfx(SFXNEXT)
}
canSkip {tt>_grace}
next() {
if (canSkip && (TIC.btnp(0) || TIC.btnp(1) || TIC.btnp(2) || TIC.btnp(3) || TIC.btnp(4) || TIC.btnp(5) || TIC.btnp(6) || TIC.btnp(7))) {
finish()
nextstate.reset()
return nextstate
}
return this
}
}
class SplashStateText {
t { _t }
tx { _tx }
construct new(t, tx) {
_t=t
_tx=tx
}
}
class SplashState is SkipState {
construct new() {
super(10)
_len=250
_texts=[
SplashStateText.new(0,"^56u"),
SplashStateText.new(1,"^56u^deni"),
SplashStateText.new(2,"^56u^deni^56c^deorns"),
SplashStateText.new(3,"^56u^deni^56c^deorns\n^56o^def"),
SplashStateText.new(4,"^56u^deni^56c^deorns\n^56o^def^21DEATH"),
]
}
reset() {
super.reset()
TIC.music(MUSSPLASH,-1,-1,false)
}
draw() {
super.draw()
TIC.cls(COLOR_BG)
var tx=null
for (text in _texts) {
if (tt<text.t*MUSBEATTICKS) {
break
}
tx=text.tx
}
if (tx!=null) {
var cf=ChunkyFont.new(50,40)
cf.s(tx)
}
if (tt>5.8*MUSBEATTICKS) {
drawface(170,36)
}
}
drawface(x,y) {
TIC.spr(204,x,y,0,1,0,0,4,4)
}
next() {
if (tt>=_len) {
finish()
nextstate.reset()
return nextstate
}
return super()
}
}
class TitleState is State {
construct new() {
_player=Player.new(PLAYER_DX,40,0,null)
_nextStateCounter=0
_phone=Phone.new()
_keys=[]
}
isSwitchingToNextState{_nextStateCounter>0}
reset() {
super.reset()
TIC.music(MUSTITLE,-1,-1,false)
_player=Player.new(PLAYER_DX,40,0,null)
_nextStateCounter=0
_keys=[]
}
finish() {
TIC.sfx(SFXNEXT)
_nextStateCounter=40
TIC.music() // stop
}
next() {
if(_nextStateCounter==1){
nextstate.reset()
return nextstate
}
return super()
}
update(){
super.update()
if(!isSwitchingToNextState){
_player.update(0,0)
if(_player.y>95){
finish()
}
}
if(isSwitchingToNextState){
_nextStateCounter=_nextStateCounter-1
}
// Check cheat code
for(k in BTN_UP..BTN_B) {
if(TIC.btnp(k)) {
_keys.add(k)
if (_keys.count==CHEAT_CODE.count) {
var same=true
for (i in 0..._keys.count) {
if (_keys[i] != CHEAT_CODE[i]) {
same=false
break
}
}
if (same) {
TIC.sfx(SFXRIGHT)
AUTO_DRIVE=true
SHOW_DOG=true
ENABLE_PHONE=false
}
_keys.removeAt(0)
}
break
}
}
_phone.update()
if (!_phone.isShowing()){
_phone.showPhone([
Message.new("Game hint", "Drive the car\nup/down.\nIsn't this\ngame great?","Yes!","No..."),
Message.new("Game hint", "Hitting trees\nand pedestrians\ndamages the car!","Got it","Who cares"),
Message.new("Game hint", "Answer texts\nto hide the phone","Like this","Go away"),
Message.new("Game hint", "Wrong replies\nwill freeze\nthe car","Sure","Liar"),
Message.new("Game hint", "What is 1+1?","2","I refuse")
])
}
}
draw() {
super.draw()
TIC.cls(COLOR_BG)
TIC.print(((tt/40).floor%2)==0?">>> START GAME":">>> DRIVE HERE",30,100,12+(tt/20)%2)
TIC.spr(510,20,64+((tt/20).floor%4)*10,0)
_player.draw(0,0)
_phone.draw()
var cf=ChunkyFont.new(30,20)
cf.s("^43ROAD\n^56TXTR")
}
}
class MainState is State {
construct new() {
_x=0
_y=0
_speed=2
_phone=Phone.new()
_obstacles=[]
_map=GameMap.new()
_player=Player.new(PLAYER_DX,60,_speed,_map)
_currentTime=0
_progressbar = ProgressBar.new()
_winstate=this
_deathticks=0
_lastCrossingX=0
_xinged=false
}
winstate { _winstate }
winstate=(value) {
_winstate=value
}
reset() {
super.reset()
_x=0
_player=Player.new(PLAYER_DX,60,_speed,_map)
_phone=Phone.new()
_obstacles=[]
_showText=false
_currentTime=0
_choiceMade=false
_deathticks=0
_lastCrossingX=0
TIC.music(MUSGAME,-1,-1,true)
GOOD_TEXT=0
BAD_TEXT=0
PEDESTRIANS_KILLED=[]
_xinged=false
}
setCrossing(coordX) {
// Change road tiles to crossing tiles
_lastCrossingX = _x
var tileX = (coordX/TILE_SIZE).floor
var x = tileX%(MAP_W*3)
for(y in 0...MAP_H){
if (_map.tileAtIs(x,y,ROAD_TILES)) {
TIC.mset(x,y,CROSSING_TILES[0])
TIC.mset(x+1,y,CROSSING_TILES[1])
}
y = y + 1
if (_map.tileAtIs(x,y,ROAD_TILES)) {
TIC.mset(x,y,CROSSING_TILES[2])
TIC.mset(x+1,y,CROSSING_TILES[3])
}
}
}
update() {
super.update()
if (_deathticks>0) {
_deathticks=_deathticks-1
return
} else if (_player.health<=0){
TIC.music()
_deathticks=60
}
_player.update(_x,_y)
_x=_player.x-PLAYER_DX
_phone.update()
_player.isOnGrass =_map.tileAtPixelIs(_player.x+24,_player.y+8,GRASS_TILES)
var coords=_map.findYforRandomTileWithIdsAtX(_x+WIDTH+RANDOM.int(0,60),ROAD_TILES+FOOTPATH_TILES)
if (coords!=null) {
// Xing ducks
if (AUTO_DRIVE && _x>=XING_X && !_xinged) {
_xinged=true
setCrossing(coords[0])
var duck=Oldie.new(coords[0]+4,coords[1],0,1,DUCK_SPRITE,_map,_player)
duck.xing()
_obstacles.add(duck)
for(i in 1..XING_LINGS){
var d = Oldie.new(coords[0]+4,coords[1]-i*12,0,1,DUCKLING_SPRITE,_map,_player)
d.xing()
_obstacles.add(d)
}
} else if(tt%(60-(50*_x/WIN_X).floor).floor==0) {
var dir=RANDOM.int(0,2)*2-1
var sprite=RANDOM.sample(PEDESTRIAN_SPRITES)
if(_map.tileAtPixelIs(coords[0],coords[1],ROAD_TILES)) {
// Crossing road
_obstacles.add(Oldie.new(coords[0]+RANDOM.int(0,8),coords[1],0,dir,sprite,_map,_player))
// Change road tiles to crossing tiles
if (_x > _lastCrossingX + CROSSING_GAP && RANDOM.int(0,2)==0) {
setCrossing(coords[0])
}
} else {
// Walking along sidewalk
_obstacles.add(Oldie.new(coords[0],coords[1],dir,0,sprite,_map,_player))
}
}
}
if((tt+15)%50==0) {
var coords=_map.findYforRandomTileWithIdsAtX(_x+WIDTH,FOOTPATH_TILES)
if(coords!=null) {
_obstacles.add(Post.new(coords[0],coords[1]))
}
}
if(tt%10==0) {
var coords=_map.findYforRandomTileWithIdsAtX(_x+WIDTH,GRASS_TILES)
if(coords!=null) {
if(RANDOM.int(0,2)==0) {
_obstacles.add(PalmTree.new(coords[0],coords[1]-TILE_SIZE_2))
} else {
_obstacles.add(PineTree.new(coords[0],coords[1]-TILE_SIZE_2))
}
}
}
_obstacles=_obstacles.where {|obstacle| obstacle.x>_x-100}.toList
_obstacles.each {|obstacle|
obstacle.update()
if(obstacle.isAlive&&obstacle.intersects(_player) && ENABLE_COLLISIONS && !AUTO_DRIVE) {
_player.onHit(obstacle.damage)
obstacle.onHit()
}
}
// Remove obstacles off camera
_obstacles.each {|obstacle|
if(obstacle.x<_x-50){
_obstacles.remove(obstacle)
}
}
_currentTime = _currentTime + 1
if(_currentTime == EVENT_TICK) {
if(_phone.isShowing()) {
wrongAnswer()
}
_phone.showPhone()
_currentTime = 0
}
_progressbar.update()
if (_phone.isWrong() == true) {
wrongAnswer()
}
}
next() {
_map.update(_x)
if (_x>=WIN_X) {
finish()
winstate.reset()
return winstate
}
if (_deathticks==1) {
finish()
nextstate.reset()
return nextstate
}
return super()
}
draw() {
_map.draw()
_obstacles.each {|obstacle|
if(DEBUG_HITBOX){
TIC.rectb(obstacle.x-_x+obstacle.hitbox.x,obstacle.y+obstacle.hitbox.y,obstacle.hitbox.width,obstacle.hitbox.height,5)
}
}
if(DEBUG_HITBOX){
TIC.rectb(_player.x-_x+_player.hitbox.x,_player.y+_player.hitbox.y,_player.hitbox.width,_player.hitbox.height,5)
}
var drawables=_obstacles+[_player]
drawables.sort {|a,b| a.y+a.hitbox.top < b.y+b.hitbox.top}
drawables.each {|drawable| drawable.draw(_x,_y)}
if (!AUTO_DRIVE) {
_progressbar.draw(_x)
}
_phone.draw()
}
wrongAnswer() {
_player.makeStressed()
_map.shakeItOff()
}
}
class DeathState is SkipState {
construct new() {
super(60)
_player=Player.new(WIDTH/2,HEIGHT/2,0,null)
_player.health=1
}
reset() {
super.reset()
TIC.music(MUSDEATH,-1,-1,false)
}
finish() {
return
}
update() {
super.update()
_player.update(0,0)
}
draw() {
super.draw()
TIC.cls(COLOR_BG)
_player.draw(0,0)
TIC.print("Totalled!", 50, 50, 3)
TIC.print("Press any key to restart", 40, 100, 12)
}
}
class WinState is SkipState {
construct new() {
super(300)
_corpses=[]
}
reset() {
super.reset()
TIC.music(MUSWIN,-1,-1,false)
var x=30
_corpses=PEDESTRIANS_KILLED.map{|sprite|
x=x+12
return Corpse.new(x,87+RANDOM.int(10),sprite)
}.toList
}
finish() {
SHOW_DOG=true
if (BAD_TEXT==0 && PEDESTRIANS_KILLED.count==0) {
AUTO_DRIVE=true
}
}
draw() {
super.draw()
TIC.cls(COLOR_BG)
TIC.print("You win!", 40, 30, 5)
TIC.print("Good texts: %(GOOD_TEXT)", 30, 60, 12)
TIC.print("Bad texts: %(BAD_TEXT)", 30, 70, 12)
TIC.print("Pedestrians killed: %(PEDESTRIANS_KILLED.count)", 30, 80, 12)
_corpses.each{|corpse| corpse.draw()}
if (!SHOW_DOG) {
TIC.print("Dog unlocked! (X to bork)", 30, 110, 5+((tt/10).floor%2))
}
if (BAD_TEXT==0 && PEDESTRIANS_KILLED.count==0 && !AUTO_DRIVE) {
TIC.print("PERFECT! (auto-play unlocked)", 30, 120, 5+((tt/2).floor%2))
}
if (canSkip){
TIC.print("Press any key to reset", 10, HEIGHT-10, 12)
}
}
}
class Message {
sender { _sender }
message { _message }
correct { _correct}
wrong { _wrong }
construct new (sender, message, correct, wrong) {
_sender = sender
_message = message
_correct = correct
_wrong = wrong
}
}
class Rect {
x { _x }
y { _y }
width { _width }
height { _height }
left { _x }
right { _x + width }
top { _y }
bottom { _y + height }