PDA

View Full Version : Video Game Concepts Vol. 1 (Combos)


x2495iiii
06-01-2009, 08:38 PM
I was going over some of the Alice worlds I've written in my spare time over the years and I've realized that a lot of them were centered around some concept in commercial video games that I'd seen/played and was trying to understand. Then I thought it might be fun to refine and post them to teach these concepts to everyone! So here's the first one: combos.

Background: More than a few people have posted asking about how to design a combo system using Alice. A friend of mine and I had worked on it for a short while with no success, after some thought I was able to replicate it.

Explanation: A combo is a set of methods in a game which are all called using the same action, but are called sequentially instead of simultaneously by repeating the action. Usually, the action has to be repeated quickly in order to perform the whole combo, otherwise the first method is called again.

Example: The samurai in my world performing three separate attacks, all triggered by pressing the space bar quickly three times in a row (within .2 seconds for each press)

Key Ideas: Since there is no way to initiate or interrupt a method in Alice while another method is running (unless they are run simultaneously), a similar method can be used. By infinitely looping a method which checks a number variable, strikeNum, the first attack is performed. Then, by checking to see if the variable has changed during the first attack, the second attack is performed. Finally, a third check to see if the number has changed during the second attack allows the third attack to be performed.

Application: Since infinite loops are cubersome and can often cause choppy animation in large quantities or in complex worlds, I'd recommend not using this in a large game.

x2495iiii
11-07-2009, 10:54 PM
I just realized that there's a better way to check the strikeNum variable without using an infinite loop: using a "when a variable changes" event which checks to see what value strikeNum is and does the appropriate action. With this method, it can be used in any Alice world, regardless of size or number of other ongoing actions.

Chris101b
11-08-2009, 12:19 AM
Nice, I like it.

jediaction
11-23-2009, 06:30 PM
Cool, good job

reuben2011
11-29-2009, 03:48 AM
Thats cool. Have you applied combo's to things like double jumps?

x2495iiii
11-29-2009, 08:19 AM
Yes, they're almost the same thing. That's actually part of why I haven't done a double jump yet. The idea of making an action happen right after another action is the same.