Scheme REPL with Cocos2Dx

Scheme REPL with Cocos2Dx 1.0 for android

Free Libraries & Demo Apps By Adellica
Sponsored links
Description :
This is a demo for developers. Please don't give low ratings based on playability - it's not meant to be a complete game! It may still be entertaining though, you can drive a truck up hills and fall back down.
=== What this is about ===
We have wanted to try REPL-based game development for a long time, and this is our attempt.
A REPL is like a command-line interface to the inside of your running program. It's like having a debugger running constantly, but perhaps less troublesome.
REPL-based development should allow us to develop games and apps much faster. Your new code takes effect immediately, and can be executed on your target hardware.
Bret Victor has a very nice talk about immediate feedback in his "Inventing on Principle" talk:
This project is an attempt to accomplish this, and so far it seems to have worked fairly well!
=== How we are doing this ===
The demo combines three third-party libraries:
- Chicken Scheme for the REPL
- Cocos2Dx for graphics
- Chipmunk for physics
Cocos2Dx is a C++ library with 2D-games in mind. It lets you manage things like sprites, their animations and touch events. It is fast and portable (Android, iOS and others). Chipmunk is a physics engine writtten in C. It's fast with a very nice API. Chicken Scheme is a Scheme-to-C compiler and interpreter.
All should also run on iOS, but I don't have a Mac.
=== Bindings ===
The Cocos2Dx bindings are in an early-stage. Basic functions to manipulate sprites are available:
- (CCSprite::create "CloseNormal.png")
- (setPosition *sprite* x y)
- (getLocatino touch-event)
The Chipmunk API is more mature. You can read about the `chickmunk` project on
=== Try it yourself ===
You can connect to the REPL directly from your laptop if your phone is on the same WiFi, or use USB. Try Settings->Wireless Networks->Wifi Settings-> [Menu]->Advanced when looking for you phone's IP.
With netcat (or Emacs, with netcat [ip] [port] as your Scheme interpreter), you could try:
$ nc [phone ip] [port]
Alternatively, you could use USB with adb and forward:
$ adb forward tcp:1234 tcp:1234
$ nc localhost 1234
Once you see the REPL prompt @>, you can play around:
;; 'import' chipmunk bindings
(use chickmunk)
;; where is the player?
(body-get-pos truck)
;; redefine game-loop to pause game unless you're touching the screen
(define (*update*)
(if *touch-down* (space-step space (/ 1 120))))
;; now let's give the truck a gentle push
(body-set-ang-vel wf -20)
;; now touch the screen to watch it drift off
;; restart the app to revert your changes
;; You can also manipulate the physics-world:
;; Drop a ball from the sky
(space-add space
`(body ((pos (320 700)))
(circle (density 0.001)
(friction 1)
(radius 10))))
;; Add a gentle but slippery slope
(space-add space
`(body ((static 1))
(segment (friction 0.1)
(endpoints ((250 500)
(800 550))))))
;; type this to see the touch-down state:
;; it should be #f when your finger is off the screen, and touch-coordinates otherwise. evaluate it while holding the screen to try it out!
This is just a small example of what can be done. As a matter of fact, almost everything in the demo itself was developed this way: the REPL, Emacs and Inferior Scheme.
=== Source code ===
The source-code for the demo can be found on github:
Please give feedback, let us know if you like this! And please let us know of any similar efforts. Thanks!

Download Scheme REPL with Cocos2Dx - Version: 1.0

Scheme REPL with Cocos2Dx
Process Scheme REPL with Cocos2Dx 1.0 download page
Size: 2.8MB
Requires: Android 2.2 or higher

Sponsored links

You May Also Like

URI Launcher

URI Launcher provides easy way to test executing URIs. URI Launcher will be very useful for anyone

Free Size: 919.52KB

guide: Postknight Pro 1.0

Guide for Postknight Pro game is a best guide for gamers who played Postknight games, that can play

Free Size: 2325 kb

M-ticket 1.0.1

Achetez et validez votre titre de transport directement avec votre téléphone

Free Size: 26325 kb

Birthday Quotes 1.1

Birthday QuotesA perfect & refined collection of some of the best Birthday Quotes.Some Highlights

Free Size: 3.97MB

gforth - GNU Forth for Android 0.7.9_20161123

Gforth is the GNU's project implementation of the programming language Forth. This APK is the

Free Size: 6.94MB

Step by Step Minecraft 2.0

There are 31 houses for you to choose from each of them has its own unique style. Pick the one you

Free Size: 7.87MB

IAP-Foo 1.0

Test IAP pour supporter NS

Free Size: 19.35MB

Open Router Settings 1.0.3

Known issues:◉ It seems that the app crashes on some devices instead of showing a warning

Free Size: 5.45MB

En Algún Lugar. 1.0

Esta app es el inicio del libro, prologo + capitulo 1 del libro "En algún lugar", escrito por

Free Size: 2.44MB

Credit Card Reader NFC (EMV) 4.2.4

This app was made to read public data on an NFC banking card compliant with EMV norm.Infos:This

Free Size: 2.81MB