Hi!
I just have discovered PuzzleScript and I love it!
I'm trying to write a game with sliding balls. You must try to put the green balls into a hole (target) but avoid putting the red ones. However, one all green balls have gone, it triggers the win conditions even if the red ball is about to fall into the hole.
I don't know how to write the "again" rules or the win conditions to detect this.
Here you have a Minimal Working Example. In the first level you shouldn't win:
title Minimal Working Example
author Gregorio Morales
again_interval 0.05
========
OBJECTS
========
Background .
lightgray
Wall
brown
Target
lightgray black
00000
01110
01010
01110
00000
RojoTemp
red
.....
.000.
.000.
.000.
.....
Verde
green
VerdeR
green
Rojo
red
RojoR
red
=======
LEGEND
=======
# = Wall
@ = Verde
X = Rojo
T = Target
Player = Verde or Rojo
objeto = Wall or Verde or Rojo
algoVerde = Verde or VerdeR
algoRojo = Rojo or RojoR
=======
SOUNDS
=======
================
COLLISIONLAYERS
================
Background
Target
RojoTemp
Wall, Verde, Rojo,VerdeR,RojoR
======
RULES
======
(start)
[right Verde] -> [right VerdeR]
[right Rojo] -> [right RojoR]
(slide)
[VerdeR] -> [right VerdeR] again
[RojoR] -> [right RojoR] again
(stop)
right [> VerdeR|objeto] -> [Verde|objeto]
right [> RojoR|objeto] -> [Rojo|objeto]
(fall into hole)
late [algoverde Target] -> [ Target]
late [algoRojo Target] -> [RojoTemp Target]
late [RojoTemp Target] -> sfx1 restart message Red can't fall
==============
WINCONDITIONS
==============
no algoverde
=======
LEVELS
=======
#######################
#....X..@.........T...#
#######################
#######################
#..@.X............T...#
#######################
Thank you very much,
Gregorio Morales