[ascii] blitSurface basic

This commit is contained in:
2021-04-25 14:55:12 -06:00
parent 0e98e72245
commit 4f3f599909
13 changed files with 265 additions and 12 deletions

View File

@@ -0,0 +1,184 @@
COLORS
! 128 128 255
" 255 255 255
# 98 49 0
$ 159 80 0
% 41 41 41
& 128 128 128
' 106 106 106
( 0 0 0
INFO CODES
! .
" POINT_screen
SIZE
68 33
CHARACTERS
BACKGROUND COLORS
!!!!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!!
!!!!%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%!!!!
!!!!%&''''''''''''''''''''''''''''''''''''''''''''''''''''''''&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&'(((((((((((((((((((((((((((((((((((((((((((((((((((((('&%!!!!
!!!!%&''''''''''''''''''''''''''''''''''''''''''''''''''''''''&%!!!!
!!!!%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%!!!!
!!!!%''''''''''''''''''''''''''''''''''''''''''''''''''''''''''%!!!!
!!!%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%!!!
!!!%&&''''''''''''''''''''''''''''''''''''''''''''''''''''''''&&%!!!
!!%&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&%!!
!!%&&''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&&%!!
!%&&'&&&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&%!
!%&&''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&&%!
%&&'&&&&&'&&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&'&&&&&'&&%
%&&''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&&%
CHARACTER COLORS
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00001111111111111111111111111111111111111111111111111111111111110000
00011111111111111111111111111111111111111111111111111111111111111000
00011111111111111111111111111111111111111111111111111111111111111000
00111111111111111111111111111111111111111111111111111111111111111100
00111111111111111111111111111111111111111111111111111111111111111100
01111111111111111111111111111111111111111111111111111111111111111110
01111111111111111111111111111111111111111111111111111111111111111110
11111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111
SPECIAL INFO
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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package;
import asciilib.GameLogic;
import asciilib.Graphics;
import asciilib.Colors;
import asciilib.Assets;
import asciilib.Game;
import kiss.Prelude;
@:build(kiss.Kiss.build())

View File

@@ -2,9 +2,10 @@
(defmethod new [] 0)
(defmethod :Void update [:Float deltaSeconds] 0)
(defmethod :Void draw [:Void->Graphics graphics]
(defmethod :Void initialize [:Assets assets]
(assets.loadSurface "laptop" AssetPaths.laptop__srf))
(defmethod :Void update [:Game game :Float deltaSeconds] 0)
(defmethod :Void draw [:Void->Graphics graphics :Assets assets]
(when firstDraw
(set firstDraw false)
(.setBackgroundColor (graphics) 5 5 Colors.White)
(.setLetter (graphics) 10 5 (object char "@" color Colors.Red))))
(.blitSurface (graphics) (assets.getSurface "laptop") 0 0)))

View File

@@ -12,7 +12,7 @@ class PlayState extends FlxState
override public function create()
{
super.create();
game = new Game("Beware Yon Death Trap", 40, 24, 8, 12, new DeathTrapLogic(),
game = new Game("Beware Yon Death Trap", 40, 24, 8, 12, new DeathTrapLogic(), new FlxAssetsBackend(),
new FlxGraphicsBackend(this, FlxGraphic.fromAssetKey("assets/images/size12.png"),
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,.;:/?!@#$%^&*()-_=+[]{}~ÁÉÍÑÓÚÜáéíñóúü¡¿0123456789\"'<>|"));
}