[PLUGINS] Data Structures

Completed plugins, behaviors and effects.

Post » Sat May 28, 2011 2:38 pm

Sounds like it could be helpful, but I'm not sure what for.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Sat May 28, 2011 5:19 pm

Here's a quick demo to show how each plug handles data differently. Just toggle the corresponding events for each plug type.

[url:icrxfpgf]http://dl.dropbox.com/u/666516/dqs.cap[/url:icrxfpgf]
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Sun May 29, 2011 2:08 am

Thanks for the example newt.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Sun May 29, 2011 4:37 pm

Thanks newt, it's emberassing, but I still don't know how to use in in a game. I understand the concept, but don't know where it'd be helpful. For what should I use it - score table? For what it'd be ideal? Usually, my head is full of ideas, but I can't think of one for this plug. Could someone give me a few?
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Sun May 29, 2011 7:02 pm

Well basically you want to use it when you want to keep track of a list of things that don't exist as objects. For example, scores, coordinates, colors etc. Now we have other objects that can do that, but SQD offers a different way to access that data on the fly, and either use it, or change it without having to worry about preserving order.
A good example might be powerups. Say you have a ship that gets a powerup when it collides with an object, but you don't want to use the bonus right then, like only when a player presses a button.
With Stack you can do that like a bullet clip, where the first bullet in is the last one out.

+> Ship on collision with bonusbomb
->stack push bonusbomb
+>Ship on collision with bonusfireball
-> stack push bonusfireball
+>M&K on space bar pushed
->Ship spawn object(stack.top)
->stack pop top

So with that if the ship ran into a fireball, then a bomb, and then another bomb, when you pressed space it would spawn a bomb, then another bomb, and then a fireball, but then the stack would be empty, just like a clip.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Mon May 30, 2011 5:25 pm

I don't think I could use this in a game. If a player wanted to use the fireball, they'd have to waste 2 bombs before. You gave me an idea where it could be used - cards game.
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Mon May 30, 2011 5:56 pm

Thats just for Stack, to pick within the list you would use Deque.
Also yeah card games would be a good example.
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Mon May 30, 2011 8:23 pm

Awesome! This should definitely be added to the "core" plugins! I'll be using it a lot! :D
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Mon May 30, 2011 9:47 pm

If this can do what I'm hoping it can do, it should be VERY useful and far quicker than certain previous methods of doing certain things.
B
2
S
2
G
2
Posts: 372
Reputation: 1,794

Previous

Return to Completed addons

Who is online

Users browsing this forum: No registered users and 1 guest