Commit be53c61e by Phil Hagelberg

Minor tweak thingies.

parent 3159b02e
.love-release
releases
......@@ -9,22 +9,11 @@ check:
count:
cloc ${LUA}
test:
luajit test.lua
test_51:
lua test.lua
test_52:
lua5.2 test.lua
REL=".love-release/build/love-release.sh"
FLAGS=-a 'Phil Hagelberg' \
--description 'Card thingy.' --love 0.10.1
FLAGS=-a 'Phil Hagelberg' --description 'Hypertext authoring tool.' --love 0.10.1
mac:
$(REL) $(FLAGS) -M
windows:
$(REL) $(FLAGS) -W -W32
......@@ -4,6 +4,15 @@ A [HyperCard](https://en.wikipedia.org/wiki/HyperCard)-like authoring
tool, but with elements of [Scratch](https://scratch.mit.edu). Cards
can have buttons as well as characters that can have their own images.
Download:
* [Mac OS X](https://p.hagelb.org/cardinality/Cardinality-macosx-x64.zip)
* [Windows](https://p.hagelb.org/cardinality/Cardinality-win32.zip)
* [Portable](https://p.hagelb.org/cardinality/Cardinality.love)
Windows and Mac OS X releases are standalone, but the portable `.love`
file requires having [LÖVE](https://love2d.org) version 0.10.x.
Differences from HyperCard:
* Lua instead of HyperTalk
......@@ -22,14 +31,18 @@ Not all of this is finished; see TODO below.
## Usage
There's a help button when you launch that explains everything through
an in-game tutorial.
Use the right mouse button to open the menu for commands and tools.
* Arrow (orange): play mode
* Hand (orange): play mode
* Plus (light yellow): create new card
* Jump (dark blue): jump to any card
* Brackets (dark purple): edit card's code
* Horizontal bar (green): button mode
* Face (bright yellow): character mode
* Stop sign (deep red): quit
* Palette (light purple): select color
* Dropper (light blue): dropper tool
* Pencil (pink): set pixel
......@@ -56,17 +69,19 @@ button, and character code, but you can disable the sandbox with
`nosb()` and re-enable it with `require("execute").activate_sandbox()`.
Instead of having an erase tool, you can choose "transparent" as your
paint color by pressing space in the color picker tool.
paint color by pressing space in the color picker tool, then use the
pencil, fill, etc.
## Developing
If you're running from a checkout of the source, you will need to
symlink the `example` directory into your LÖVE save dir (often
symlink the `main` directory into your LÖVE save dir (often
`~/.local/share/love/cardinality`) in order for your changes to that
stack to be saved.
## TODO:
* API reference
* Character collisions
* Rename character
* Re-label button
......
......@@ -30,7 +30,14 @@ return {
love.graphics.draw(ch.costume_images[ch.costume], ch.x, ch.y)
end,
move = function(ch, x, y)
ch.x, ch.y = ch.x + x, ch.y + y
end,
move_to = function(ch, x, y)
ch.x, ch.y = x, y
end,
-- TODO: move to a new card, relative move
to_card = function(ch, card_name)
local from, to = card.current(), card.find(card_name)
from.characters[ch.name] = nil
to.characters[ch.name] = ch
end,
}
local lume = require("lib.lume")
local utf8 = require("utf8")
local polywell = require("polywell")
local inspect = require("lib.inspect")
local card = require("card")
......@@ -31,7 +30,6 @@ local sandbox = {
math = lume.clone(math),
table = lume.clone(table),
string = lume.clone(string),
utf8 = lume.clone(utf8),
-- love
graphics = lume.clone(love.graphics),
......
return {["buttons"]={[1]={["x"]=8,["code"]="card.new_stack()",["y"]=56,["meta"]={},["label"]="new stack",["w"]=100,["type"]="button",["h"]=20},[2]={["x"]=189,["code"]="local button, card = ...",["y"]=86,["meta"]={["jump_to"]="second"},["label"]="help",["w"]=100,["type"]="button",["h"]=20},[3]={["x"]=190,["code"]="quit()",["y"]=119,["meta"]={},["label"]="quit",["w"]=100,["type"]="button",["h"]=20},[4]={["x"]=8,["code"]="editor.read_line(\"Stack: \", function(name, cancel)\
return {["buttons"]={[1]={["x"]=17,["code"]="card.new_stack()",["y"]=52,["meta"]={},["label"]="new stack",["w"]=100,["type"]="button",["h"]=20},[2]={["x"]=141,["code"]="local button, card = ...",["y"]=71,["meta"]={["jump_to"]="second"},["label"]="help",["w"]=100,["type"]="button",["h"]=20},[3]={["x"]=141,["code"]="quit()",["y"]=104,["meta"]={},["label"]="quit",["w"]=100,["type"]="button",["h"]=20},[4]={["x"]=17,["code"]="editor.read_line(\"Stack: \", function(name, cancel)\
if(cancel) then return end\
card.load(name) end, {completer=card.stack_completer, moused=true})",["y"]=86,["meta"]={},["label"]="load stack",["w"]=100,["type"]="button",["h"]=20},[5]={["x"]=8,["code"]="editor.read_line(\"Copy stack: \", function(name, cancel)\
card.load(name) end, {completer=card.stack_completer, moused=true})",["y"]=86,["meta"]={},["label"]="load stack",["w"]=100,["type"]="button",["h"]=20},[5]={["x"]=17,["code"]="editor.read_line(\"Copy stack: \", function(name, cancel)\
if(cancel) then return end\
editor.read_line(\"New stack name: \", function(new_name, cancel)\
card.copy_stack(name, new_name)\
end)\
end, \
{completer=card.stack_completer, moused=true})",["y"]=118,["meta"]={},["label"]="copy stack",["w"]=100,["type"]="button",["h"]=20}},["code"]="",["image_file"]="start.png",["characters"]={},["name"]="start"}
\ No newline at end of file
{completer=card.stack_completer, moused=true})",["y"]=119,["meta"]={},["label"]="copy stack",["w"]=100,["type"]="button",["h"]=20}},["code"]="",["image_file"]="start.png",["characters"]={},["name"]="start"}
\ No newline at end of file
......@@ -18,6 +18,8 @@ local close = function() editor.change_buffer(editor.last_buffer()) end
editor.bind("play", "ctrl-return", lume.fn(editor.change_buffer, "*console*"))
editor.bind("play", "ctrl-z", save.undo)
editor.bind("play", "ctrl-0", lume.fn(card.load, "main"))
editor.bind("console", "escape", close)
editor.bind("console", "ctrl-return", close)
editor.with_current_buffer("*console*",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment