85 lines
1.7 KiB
Plaintext
85 lines
1.7 KiB
Plaintext
http://www.w3schools.com/games/tryit.asp?filename=trygame_default_gravity
|
|
|
|
test change.
|
|
|
|
|
|
cat game ???
|
|
gems
|
|
diff kinds of cats, and food
|
|
|
|
swap cat with food = cat chomps food. minor points for food vanish.
|
|
food: dry food
|
|
food: wet food
|
|
food: cheese
|
|
food: ham
|
|
|
|
cat gets fatter ?
|
|
|
|
line of diff cats = cat parade. medium points.
|
|
line of same cats = big points!
|
|
line of cats with goat at the end = get rid of lots!
|
|
|
|
any parade gives you more moves.
|
|
|
|
|
|
game params:
|
|
# of moves limit
|
|
score
|
|
|
|
|
|
|
|
|
|
array of "objects" (which can be a cat, food, etc)
|
|
each object is a fixed square size
|
|
applygravity()
|
|
obejcts always fall downwards if there is no obejct under them.
|
|
blowup()
|
|
give points or extra moves, then vanish.
|
|
|
|
mouse down:
|
|
can't do this unless all objects are finished moving.
|
|
start dragging line, add current under-object to path.
|
|
|
|
mouse move:
|
|
if dragging a line:
|
|
...if under object isn't in path
|
|
...and under object is valid for this path
|
|
(ie. a swap with first element before it, or a parade)
|
|
then add under obejct to path
|
|
|
|
otherwise:
|
|
path becomes invalid.
|
|
|
|
mouse up:
|
|
if valid path:
|
|
if swap:
|
|
chomp fruit
|
|
move cat to fruit's position
|
|
cat gets bigger?
|
|
if line:
|
|
all vanish (or zoom off)
|
|
|
|
now decrement movesleft.
|
|
|
|
main loop
|
|
move stuff
|
|
draw cats / score
|
|
check input
|
|
check for endgame (no moves left)
|
|
|
|
|
|
|
|
----------------------------
|
|
|
|
start:
|
|
|
|
*have a grid of things
|
|
*click one, rest fall down and a new one is generated
|
|
*drag across multi, all disappear, rest fall, new are generated
|
|
*don't allow clicks until all grid locations are full
|
|
|
|
*allow cat->food or cat->...->cat
|
|
|
|
cat eating food should take its place
|
|
|