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.


Messages - drhayes

Pages: 1
1
Ask a Question / Re: Compare the contents of two lists for equality
« on: August 14, 2013, 09:15:58 pm »
For anyone following along at home, I took Tuo's code and broke out the combos and their corresponding events.

The behavior, in the end, takes a Duration (Number), a list of Combos (Text, each move separated by a comma), and a corresponding list of Events (each a Text).

Just like in Tuo's solution, the behavior accumulates the keypresses in a hidden attribute. It then compares the value of the hidden attribute against each text in the list of combos and, if it matches, triggers the corresponding event.

2
Ask a Question / Re: Compare the contents of two lists for equality
« on: August 14, 2013, 11:51:24 am »
Ah, excellent, thanks for the code, Tuo!

My next step was going to be to enforce a time limit and you've gone and done my work for me. ( =

I like your approach of breaking it down into an event, as well.

3
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