Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

30 Commits

Repository files navigation

FriceEngine on Lisp

Racket edition of frice engine is a little different from others(JVM/CLR).
The latest version is 0.14.

Demo (-FlappyBird)

#lang racket
(require"engine.rkt")
;;flappy bird
(game (bounds 600480)
(title "flappy bird")
(oval #:id"bird"#:x30#:y80#:width60#:height30#:fill-color"orange"#:when-colliding (lambda ()
(tell "bird"'set'stop?#t)
(text #:content"You Lose"#:text-size20#:x250#:y200#:color"red")
(tell "clock"'set'stop?#t)
)
#:object-class"block"
)
(rectangle #:id"cilent"#:x0#:y0#:width600#:height480)
(when-left-clicking #:thunk (lambda ()
(tell "bird"'set'velocity-y-0.16)
(tell "bird"'set'accelerate-y0.0005)))
(when-left-clicking #:object-class"block"#:thunk (lambda ()
(display "hello")))
(every #:interval1800#:thunk (lambda ()
(rectangle #:x600#:y0#:height (random 50260) #:width20#:velocity-x-0.1#:class"block"#:fill-color"green"
)
(rectangle #:x600#:y300#:height (random 50180) #:width20#:velocity-x-0.1#:class"block"#:fill-color"blue"
)
)
#:id"clock"
) )

API Reference

all objects share two properties : id & class
In a certain game,two different objects can't have duplicate ids.

Shapes :

shared properties : x y width height when-colliding object object-class
velocity-x velocity-y accelerate-x accelerate-y stop?
rectangle : fill-color
oval :fill-color
text :content color text-size text-style

Events :

shared properties : object object-class thunk
when-left-clicking
when-right-clicking
when-mouse-moving
when-drapping

Timers :

every : interval
stop?
thunk

Object Managers :

tell object-id msg
tellc object-class msg

(tell "bird" 'set 'x 66)

Contributors

About

FriceEngine on Racket (a dialect of lisp)

Resources

Stars

6 stars

Watchers

6 watching

Forks

Releases

Packages

Contributors

Languages