Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - drhayes

Pages: 1
Ask a Question / Compare the contents of two lists for equality
« on: August 13, 2013, 10:21:35 pm »
First time poster, brand new Stencyler. Hi there! ( =

I'm working on a combo system. The player presses four controls in a row (e.g. up, up, up, jump) and then something happens.

The way I'm implementing it now is I have two lists as attributes in an Actor behavior: one for the required moves and one for the recent moves. In the updated block of my behavior I check if the controls I'm interested in have been pressed and, if so, add them to the end of the recent moves list. If the length of the recent moves list is longer than the required moves list then I remove the first element of the recent moves list.

My problem is that I have a block that reads "if moves list = recent moves list" that doesn't seem to be triggering even though I know the two lists are equal in content. Does Stencyl not do list equality by content? If not, any suggestions?

I'll take suggestions for how to make this more general, too. I couldn't figure out how to change text (e.g. "up") into a reference to a specific control. I'd love to have a custom block that reads (more or less), "if actor does these moves then..."

Pages: 1