clean up the docs for the Planet Cute images
This commit is contained in:
parent
2b7fedb79b
commit
f48e12240a
|
@ -5,7 +5,7 @@
|
|||
|
||||
(define-syntax (definitions stx)
|
||||
#`(begin
|
||||
#,@(for/list ([img (in-list images)])
|
||||
#,@(for/list ([img (in-list (apply append (map cdr images)))])
|
||||
(define req (string->symbol (format "2htdp/planetcute/~a" (name->filename img))))
|
||||
#`(begin
|
||||
(provide #,img)
|
||||
|
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
@ -15,53 +15,69 @@
|
|||
(format "~a.png" (apply string (reverse new-chars))))
|
||||
|
||||
(define images
|
||||
'(brown-block
|
||||
character-boy
|
||||
character-cat-girl
|
||||
character-horn-girl
|
||||
character-pink-girl
|
||||
character-princess-girl
|
||||
chest-closed
|
||||
chest-lid
|
||||
chest-open
|
||||
dirt-block
|
||||
door-tall-closed
|
||||
door-tall-open
|
||||
enemy-bug
|
||||
gem-blue
|
||||
gem-green
|
||||
gem-orange
|
||||
grass-block
|
||||
heart
|
||||
key
|
||||
plain-block
|
||||
ramp-north
|
||||
ramp-south
|
||||
ramp-west
|
||||
roof-east
|
||||
roof-north-east
|
||||
roof-north-west
|
||||
roof-north
|
||||
roof-south-east
|
||||
roof-south-west
|
||||
roof-south
|
||||
roof-west
|
||||
shadow-east
|
||||
shadow-north-east
|
||||
shadow-north-west
|
||||
shadow-north
|
||||
shadow-side-west
|
||||
shadow-south-east
|
||||
shadow-south-west
|
||||
shadow-south
|
||||
shadow-west
|
||||
stone-block-tall
|
||||
stone-block
|
||||
tree-short
|
||||
tree-tall
|
||||
tree-ugly
|
||||
wall-block-tall
|
||||
wall-block
|
||||
water-block
|
||||
window-tall
|
||||
wood-block))
|
||||
'((Characters
|
||||
character-boy
|
||||
character-cat-girl
|
||||
character-horn-girl
|
||||
character-pink-girl
|
||||
character-princess-girl
|
||||
enemy-bug
|
||||
speechbubble)
|
||||
|
||||
(Items
|
||||
chest-closed
|
||||
chest-lid
|
||||
chest-open
|
||||
gem-blue
|
||||
gem-green
|
||||
gem-orange
|
||||
heart
|
||||
key
|
||||
rock
|
||||
selector
|
||||
tree-short
|
||||
tree-tall
|
||||
tree-ugly
|
||||
yellow-star)
|
||||
|
||||
(Blocks
|
||||
brown-block
|
||||
dirt-block
|
||||
grass-block
|
||||
plain-block
|
||||
stone-block-tall
|
||||
stone-block
|
||||
wall-block-tall
|
||||
wall-block
|
||||
water-block
|
||||
wood-block)
|
||||
|
||||
(Ramps
|
||||
ramp-east
|
||||
ramp-north
|
||||
ramp-south
|
||||
ramp-west)
|
||||
|
||||
(Buildings
|
||||
door-tall-closed
|
||||
door-tall-open
|
||||
roof-east
|
||||
roof-north-east
|
||||
roof-north-west
|
||||
roof-north
|
||||
roof-south-east
|
||||
roof-south-west
|
||||
roof-south
|
||||
roof-west
|
||||
window-tall)
|
||||
|
||||
(Shadows
|
||||
shadow-east
|
||||
shadow-north-east
|
||||
shadow-north-west
|
||||
shadow-north
|
||||
shadow-side-west
|
||||
shadow-south-east
|
||||
shadow-south-west
|
||||
shadow-south
|
||||
shadow-west)))
|
||||
|
|
|
@ -10,5 +10,5 @@
|
|||
@include-section["batch-io.scrbl"]
|
||||
@include-section["image.scrbl"]
|
||||
@include-section["universe.scrbl"]
|
||||
@include-section["port.scrbl"]
|
||||
@include-section["planetcute.scrbl"]
|
||||
@include-section["port.scrbl"]
|
||||
|
|
BIN
collects/teachpack/2htdp/scribblings/PlanetCuteShadowMockup.jpg
Executable file
BIN
collects/teachpack/2htdp/scribblings/PlanetCuteShadowMockup.jpg
Executable file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
BIN
collects/teachpack/2htdp/scribblings/PlanetCuteShadowTest.png
Executable file
BIN
collects/teachpack/2htdp/scribblings/PlanetCuteShadowTest.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 166 KiB |
|
@ -4,8 +4,11 @@
|
|||
"port.rkt"
|
||||
scribble/manual
|
||||
scribble/eval
|
||||
(for-syntax racket/base)
|
||||
2htdp/image
|
||||
racket/runtime-path
|
||||
racket/draw
|
||||
racket/class
|
||||
(for-syntax racket/base)
|
||||
(for-label 2htdp/image
|
||||
2htdp/planetcute))
|
||||
|
||||
|
@ -20,8 +23,8 @@
|
|||
@(interaction-eval #:eval pc-eval (require 2htdp/planetcute))
|
||||
|
||||
The @racketmodname[2htdp/planetcute] library contains the
|
||||
Planet Cute art by Daniel Cook (Lostgarden.com),
|
||||
@url{http://www.lostgarden.com/2007/05/dancs-miraculously-flexible-game.html},
|
||||
@link["http://www.lostgarden.com/2007/05/dancs-miraculously-flexible-game.html"]{Planet Cute}
|
||||
art by Daniel Cook (Lostgarden.com).
|
||||
|
||||
The images are designed to be overlaid with each other to build
|
||||
scenes for use in games. Here is an example image taken
|
||||
|
@ -29,6 +32,8 @@ from the Planet Cute website.
|
|||
|
||||
@racketblock+eval[#:eval
|
||||
pc-eval
|
||||
(code:comment "stacks its arguments on each")
|
||||
(code:comment "other, separated by 40 pixels")
|
||||
(define (stack arg . args)
|
||||
(cond
|
||||
[(null? args) arg]
|
||||
|
@ -36,25 +41,42 @@ from the Planet Cute website.
|
|||
(apply stack args))]))]
|
||||
@interaction[#:eval
|
||||
pc-eval
|
||||
(scale
|
||||
1
|
||||
(beside/align
|
||||
"bottom"
|
||||
(stack wall-block-tall stone-block)
|
||||
(stack character-cat-girl
|
||||
stone-block stone-block
|
||||
stone-block stone-block)
|
||||
water-block
|
||||
(stack grass-block dirt-block)
|
||||
(stack grass-block dirt-block dirt-block)))]
|
||||
(beside/align
|
||||
"bottom"
|
||||
(stack wall-block-tall stone-block)
|
||||
(stack character-cat-girl
|
||||
stone-block stone-block
|
||||
stone-block stone-block)
|
||||
water-block
|
||||
(stack grass-block dirt-block)
|
||||
(stack grass-block dirt-block dirt-block))]
|
||||
|
||||
@(close-eval pc-eval)
|
||||
|
||||
The Planet Cute images also include some shadows that can improve the
|
||||
look of your game; see the @secref["pc:Shadows"] section for an overview
|
||||
of how to use them.
|
||||
|
||||
@(require (for-syntax 2htdp/private/planetcute-image-list))
|
||||
@(define-syntax (defthings stx)
|
||||
#`(begin
|
||||
#,@(for/list ([img (in-list images)])
|
||||
(define req (string->symbol (format "2htdp/planetcute/~a" (name->filename img))))
|
||||
#`@defthing[#,img image?]{ @(bitmap #,req) })))
|
||||
(syntax-case stx ()
|
||||
[(_ what whatever ...)
|
||||
(identifier? #'what)
|
||||
(let* ([sym (syntax-e #'what)]
|
||||
[sec-title (symbol->string sym)]
|
||||
[these-images (cdr (assoc sym images))])
|
||||
#`(begin
|
||||
@section[#:tag #,(format "pc:~a" sec-title) #,sec-title]
|
||||
whatever ...
|
||||
#,@(for/list ([img (in-list these-images)])
|
||||
(define req (string->symbol (format "2htdp/planetcute/~a" (name->filename img))))
|
||||
#`@defthing[#,img image?]{ @(bitmap #,req) })))]))
|
||||
|
||||
@defthings[]
|
||||
@(define-runtime-path PlanetCuteShadowTest.png "PlanetCuteShadowTest.png")
|
||||
|
||||
@defthings[Characters]{}
|
||||
@defthings[Blocks]{}
|
||||
@defthings[Items]{}
|
||||
@defthings[Ramps]{}
|
||||
@defthings[Buildings]{}
|
||||
@defthings[Shadows]{@(make-object bitmap% PlanetCuteShadowTest.png)}
|
||||
|
|
Loading…
Reference in New Issue
Block a user