Drawsprite Plugin

Post your completed addons to share with the community

Post » Sat Oct 20, 2012 3:44 pm

* MY COLS AND ROWS WERE BACKWARDS IN THE PLUGIN FIXED NOW*

I have created a plugin called Drawsprite.

you can do the following:

Create a random maze with 1 event
Draw a sprite path
Draw sprite lines at any location
Draw with 2 different sprites

You draw with a string that defines what is drawn.

Drawsprite Plugin

Example CAPX

Live demorfisher2012-10-21 19:55:23
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Sat Oct 20, 2012 8:19 pm

I forgot to detail how to use the plugin. I will start with the maze options.

Object = the sprite used for the maze
Layer = is the layer number or name of the layer
X & Y Grid size = The size of each section of the maze. How many objects/sprites used per rows and cols.
Rows and Cols = Defines how many rows and cols make up the maze.
X and Y postion = define the x,y position of the maze based on the upper left corner.
Width & Height override = allows you to override the spacing of the sprite.
Post Exception String = is used to remove part of the maze after it is created. Its like "row,col" which could be "2,3"
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Sat Oct 20, 2012 9:46 pm

Awesome! i tested it and it's designed for procedural generation games, i had some problems when i'm trying to create with:

-Draw Sprite
-Draw 2 Sprites then i got:




and i'm not sure what does about "Draw Sprite Path"
B
96
S
25
G
20
Posts: 3,054
Reputation: 22,642

Post » Sat Oct 20, 2012 10:00 pm

@Joannesalfa - send me a capx

draw sprite set string examples:

"10,10,dul,3" - draw sprite at x=10, y=10, diagonal upper left 3 sprites.
"10,10,dur,3" - draw sprite at x=10, y=10, diagonal upper right 3 sprites.
"10,10,dll,3" - draw sprite at x=10, y=10, diagonal lower left 3 sprites.
"10,10,dlr,3" - draw sprite at x=10, y=10, diagonal lower right 3 sprites.
"10,10,ulc,3" - draw sprite at x=10, y=10, upper left corner 3 sprites.
"10,10,urc,3" - draw sprite at x=10, y=10, upper right corner 3 sprites.
"10,10,llc,3" - draw sprite at x=10, y=10, lower left corner 3 sprites.
"10,10,lrc,3" - draw sprite at x=10, y=10, lower right corner 3 sprites.
"10,10,l,3" - draw sprite at x=10, y=10, left 3 sprites.
"10,10,r,3" - draw sprite at x=10, y=10, right 3 sprites.
"10,10,u,3" - draw sprite at x=10, y=10, up 3 sprites.
"10,10,d,3" - draw sprite at x=10, y=10, down 3 sprites.

You can chain these strings together.

Another CAPX more examplesrfisher2012-10-21 19:55:41
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Sun Oct 21, 2012 6:54 am

wow this looks like fun! I will have to give this a go if I ever my Dungeon Crawler.
B
32
S
9
G
3
Posts: 275
Reputation: 8,063

Post » Sun Oct 21, 2012 2:33 pm

Wow! This is just what i needed!

Thanks so much for this.

Can you make an example CAPX that shows off the Post Exception String in action? I've messed around with it, but i'm not sure i understand what it does (i can't really see any parts of the maze being destroyed)
B
18
S
3
G
1
Posts: 35
Reputation: 1,875

Post » Sun Oct 21, 2012 3:24 pm

@yanen

* MY COLS AND ROWS ARE BACKWARDS IN THE PLUGIN *


Here is a live demo show what the post exception string can do.

Live demo

CAPX

The post exception string for this maze is "0,3,8,5,0,1,8,3,2,5,5,4"

3 numbers seperated by commas make up one exception. The first number represents col. The second number represents row. The third number represents the wall of the maze cell to remove. Think of the cell as a box with 4 sides. The top side is defined as 1, right side as 2, bottom side as 4, and the left side as 8.

Also note that this maze dimension is 6x9 and when you reference a cell its done like you do an array, (0,0) is the upper left corner and (5,8) is the lower right corner.rfisher2012-10-21 19:56:06
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Post » Sun Oct 21, 2012 3:51 pm

Ohh ok i get ya.

Thanks for that example, that clears it up
B
18
S
3
G
1
Posts: 35
Reputation: 1,875

Post » Wed Oct 24, 2012 7:05 am

[QUOTE=rfisher] @Joannesalfa - send me a capx

[/QUOTE]

http://dl.dropbox.com/u/76227787/drawSpriteBug.capx
B
96
S
25
G
20
Posts: 3,054
Reputation: 22,642

Post » Wed Oct 24, 2012 2:22 pm

@Joannesalfa


This is how you used the plugin. The format for the set string is (x,y,direction(l,r,u,d),distance).


Here is a example of it working.

I guess i need to put some error checking into the string parsing part of my plugin.
rfisher2012-10-24 14:25:37
B
17
S
9
G
7
Posts: 249
Reputation: 6,922

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests