A tree waving in the wind.

For questions about using Classic.

Post » Wed Jun 06, 2012 2:18 am

Hey Guys!

Been all through the forums trying to find a good answer for what I'm trying to do (no point in posting a cap yet as I've removed all bits regarding the issue).

I'm trying to make a tree bend in a wind storm. Entirely 2D - I figured a distort effect using columns and rows would handle it. I want the bottom of the tree to not move at all and every row towards the top it moves a bit more.

I've tried doing the basic stuff like SINE - but it rotates the whole object. I figured maybe having the code set to grab the x distortion from the previous row and adding a value to it - but the rows above the moving one do not respond to it, they only see the adition value I've added.

http://www.youtube.com/watch?v=7YV_hPTT8PQ

Go to 1:47 into the video.

Ghouls n Ghosts for the tg16/supergrafx has the effect I'm trying to go for. I feel like I was close but I screwed something up.

I considered animating the trees but I kinda like this cheesy effect.

Any help is greatly appriciated! I'm not a total noob on here my account wouldn't let me reset the password so I gave up and made a new account (damainman69). I was learning Construct last year by rebuilding the first level of the Black Tiger arcade game :)

Anyhow, Thanks in advance for any help!!!

DMM
B
45
S
12
G
7
Posts: 339
Reputation: 7,899

Post » Wed Jun 06, 2012 4:43 am

I think I solved it - I'll post a pic. Seems to be doing what I want, just need to put it oin the proper place right now!

B
45
S
12
G
7
Posts: 339
Reputation: 7,899

Post » Wed Jun 06, 2012 4:44 am

B
45
S
12
G
7
Posts: 339
Reputation: 7,899

Post » Wed Jun 06, 2012 4:53 pm

Or you could use the tree crown sprite seperate and use horizontal skew on it^^

edit: here an example with warp and skew. You have to tweak some numbers, but it doesn't looks too odd :P.

https://dl.dropbox.com/u/26932498/tree_wind.capzyblade2012-06-06 17:03:16
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Wed Jun 06, 2012 5:32 pm

It looks like (in Ghouls 'n Ghosts) the trunk is actually a separate texture to the canopy. So the trunk doesn't have the distort effect, and the distort effect starts at the very bottom of the canopy texture.

Make sure your hotspot is in the right place too. If the sine effect is spinning your tree, maybe your hotspot is in the middle of the tree texture. Place it at the bottom of the trunk (or bottom of the canopy, if you split the trunk and canopy into two different textures) and you should get much better results.

Hand animating does look a heck of a lot better, but it also affects VRAM usage a lot too. I created a 20 frame animation for five different trees, put them into a .CAP, and created a dynamic wind effect to animate them. Looked great! But what would have been 5 different textures using warp/sine/distort effects, became 100 different textures with this hand animated technique. Not cool.
B
15
S
7
G
7
Posts: 250
Reputation: 5,298

Post » Wed Jun 06, 2012 8:30 pm

Here's a vid. Making this game for my daughter. This would be the first level after she saves me and I carry her on my back until the end of the game. This is supposed to look similar to GNG as its my "nightmare" level. Lots of bugs still, the music isnt mine yet - doing that last. Font is the only thing I didnt hand draw (or draw by pixel). Missing stuff and the attack pattern is just a testing one.

http://www.youtube.com/watch?v=EvrCzg8liPc
B
45
S
12
G
7
Posts: 339
Reputation: 7,899


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest