# dodecagon's

### » Sun Aug 14, 2011 7:26 am

Hi Guy's,

I'm woring on a remake of Star Castle.

Basically Star Castle has 3 dodecagons that rotate around each other.
When the play shoot a side then it disapears.

Here's a video of what it looks like link

I was trying to work out the bast way to aproach it.

Should I cut a dodecagon into pizza slices then rotate them from a hotspot in the centre?

Or is it better just to get single line sprites and plot there course around the screen (which seems like a lot of work).

Any other suggestions welcome.
B
15
S
1
G
3
Posts: 47
Reputation: 1,912

### » Sun Aug 14, 2011 10:35 am

Interesting little problem, I liked the look in that video, so here's my take on it.

Really simple - just a displaced pivot and then a loop rotates and places them to insure a decent fit.

You'd have to do some maths to find out the angles and distances for a Decagon, but the idea would be the same.

B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

### » Sun Aug 14, 2011 1:36 pm

Wow that's great!
You can alway's learn heaps from a good example:
- Just using white sprites and adding the tint (that was neat)
- Creating all the new sprites and setting them to the right angle via loopindex
- getting them to rotate via rotate behaviour (I completely over looked this)

But I couldn't work out how you got them all into position. You destroy the original sprites so how do they all form a ring in the right order?
Is it because on the frist tick a sprite is added, set it it's angle then rotated and then the same on the 2nd tick, etc ShabbyCat2011-08-14 13:38:08
B
15
S
1
G
3
Posts: 47
Reputation: 1,912

### » Sun Aug 14, 2011 2:19 pm

The magic happens in the sprite itself - the pivot point is offset a different length for each color - so basically everything else just happens by itself.

When you click a sprite you'll see the pivot off to the side. I had to do a little experimenting to find out which values work for which side count and distance, but it took seconds basically. Double click a sprite an click the little red and blue target icons at the bottom and you can change the pivot offset.

Another thing to try - it seemed like in the video these were nicely pulsing as well - I did achieve that effect by using the excellent Scale Behaviour by linkman. Just set it to something like 125% horizontal scale and 700% vertical scale, looping on and loop mode to ping-pong and BAM! pulsing away.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

### » Sun Aug 14, 2011 2:30 pm

Actually if we assume that you'd only need 10 sides you can reuse the same object and just sort-of scale it to achieve as many layers as you like.

Here's an example.

To have the attack light balls like in the video you'd probably have to set up an image point on the middle of the line sprite and then pair them up. But overall everything that could be seen in that video seems quite doable and might turn out looking and playing quite nicely.

Edit: You can now click to destroy individual lines just to get a feel for it.Somebody2011-08-14 14:31:58
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

### » Sun Aug 14, 2011 2:42 pm

How did you put an expression in the color filter?
B
12
S
2
G
2
Posts: 54
Reputation: 1,665

### » Sun Aug 14, 2011 2:47 pm

[QUOTE=alessandroLino] How did you put an expression in the color filter? [/QUOTE]
Yeah, took me a while as well - right click the Filter and pick Use Expression.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

### » Sun Aug 14, 2011 3:37 pm

That's cool.
I haven't tried adding the Scale bahaviour, but I have a player ship and the turret going.

.cap

Guess I'll work on the bullets and removing those walls (like in your example).

B
15
S
1
G
3
Posts: 47
Reputation: 1,912

### » Sun Aug 14, 2011 4:13 pm

That's pretty cool - one thing I'd look into would be to draw the ships in some vector program, like, say, Inkscape, the result would be cleaner, sharper lines, tike this.

But that's purely aesthetic, so of no significance, really.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

### » Sun Aug 14, 2011 4:19 pm

I agree it looks better, do you save the svg as a BMP or can Construct use SVG's?

I was having a play with inkscape today, still going through the tutes. It's a bit different to a normal graphic's program but when I get the hang of it I'll update the graphics.

Have you been using construct for long? Made any games?
B
15
S
1
G
3
Posts: 47
Reputation: 1,912

Next