Stick Page Forums Archive

Combo Generator Code Help

Started by: KidDarkness | Replies: 5 | Views: 887

KidDarkness

Posts: 689
Joined: Nov 2012
Rep: 10

View Profile
Dec 28, 2013 6:05 PM #1131732
I am trying to create a useful and helpful combo generator for the stick page community to use but I haven't really coded in a long time and I need to refresh up a little but I will be in the process of making it I was wondering if anyone new any coding that would help me out...
Tjakka5

Posts: 17
Joined: Dec 2013
Rep: 10

View Profile
Jan 13, 2014 3:39 PM #1140838
Im a decent programmer, but what do you exactly need help with and in which language?
Tjakka5

Posts: 17
Joined: Dec 2013
Rep: 10

View Profile
Jan 14, 2014 7:54 AM #1141095
The logic behind it is very simple actually.

First, you want to create 3 tables, one with starting moves, one with general moves, and a last one with ending moves.
After that, you read the amount of moves the user wants in his combo and do that number minus one.

Then you want to pick a random move from the first table, use a for i = 1, userInput -1 and then randomly pick a move from the second table, and at last select a random move from the last table.

When you select a move from a table you want to instantly store it in the table, and at last just print the whole table on the screen.
Apex-Predator
2

Posts: 4,296
Joined: Mar 2012
Rep: 10

View Profile
Jan 14, 2014 11:34 PM #1141423
I thought someone was already creating this?
Scarecrow
2

Posts: 9,168
Joined: Oct 2005
Rep: 10

View Profile
Jan 15, 2014 2:04 AM #1141495
i can't be fucked figuring the whole thing out right now and i have shit to do today, but here's some psuedocode (which won't work but will give you an idea of what to do)



//set your variables first
var startermoves:Array = new array;
var middlemoves:Array = new array;
var finishermoves:Array = new array;

var randNum:int = new integer;
var combo:String = "";

//shove in as many moves as you want here
startermoves = ["face punch", "spinning kick", "uppercut", "etc"]
middlemoves = ["low punch", "middle punch", "high punch", "punch flurry", "low kick," "axe kick", "etc]
finishermoves = ["flying kick", "face slam", "piledriver", "roundhouse kick", "special ability", etc]

//whenever you want the combo to be generated (ie. on a button click or frame event or whatever):
randNum = Math.round(Math.random() * startermoves.length);
combo += startermoves(randNum); //add the data for the randomly generated array position to the combo string

//this middle moves could be repeated several times to generate longer combos
randNum = Math.round(Math.random() * middlemoves.length);
combo += middlemoves(randNum);

randNum = Math.round(Math.random() * finishermoves.length);
combo += finishermoves(randNum);

//assuming "comboTxt" is a dynamic text field on stage
comboTxt.text = combo;


or some shit like that
KidDarkness

Posts: 689
Joined: Nov 2012
Rep: 10

View Profile
Jan 31, 2014 8:05 PM #1150563
sorry I completely forgot I made this thread but I have been trying to figure it out.. and What I need help with is the basic code that I would use and AS 2.0 is the language I know basic coding with AS 2.0 but i haven't really done anything majorly complex with it.. but more help would be greatly appreciate :D also thanks scarecrow!! :D
Website Version: 1.0.4
© 2025 Max Games. All rights reserved.