Attaching images to image frames?

For questions about using Classic.

Post » Tue May 04, 2010 3:00 pm

I want to make shadows for each character, and I was wondering if it's possible to program it where a shadow pic could just be attached to the character. Here is an explanation:

'A' represents the character

'B' represents the shadow

I want to program it where 'B' attaches itself to 'A', and makes 'B' move with each direction 'A' has.

Now, I know I could just increase the size of the character image and then draw a shadow for each frame, but the problem there is that I would have to increase the size of my characters, and it would increase the memory size which I don't want to do because I have so many characters, plus it would degrade quality since my characters are drawn in a smaller size.

Any help is much welcomed!
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Tue May 04, 2010 3:17 pm

Are you using separate animation angles? Are you trying to make the shadow based of a fake light source? Why do you need to make the character bigger? There is a drop shadow effect as well as a plugin (those attach to the sprite). I think that's what you are looking for. You want the shadow to move in the direction the player has, but I don't quite see why you would need to do that. I use math to move a shadow in 360 on the floor of the character based on the pseudo light soruce. The description sounds like you want to do something else with the shadow.
B
2
S
2
G
4
Posts: 259
Reputation: 1,968

Post » Tue May 04, 2010 3:17 pm

You know there is a dropshadow object?
To attach a dropshadow object to multiple instances you simply put it in a container with the sprite.
Then at start of layout you do a for each on the dropshadow attaching it to the sprite.
Same goes for a dropshadow made out of a sprite, but instead of start of layout you do an always event and for each on the shadow sprite -> set position to container object.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Tue May 04, 2010 5:54 pm

I'm making a game with a pseudo-3D perspective. Here is an example of the board:



The shadows would work like this:



The black object represents the shadow.

@newt - yes. I used the example you gave and it works fine, but I'm trying to get a shadow that flattens itself to match the pseudo-3D gameboard. I'm not sure if it's even possible, but perhaps I could attach my own drawn shadow using the same example you gave? I haven't tried that yet. If you know of other ways as well I'd love to hear about those, too.

@manontherun - In reference to increasing image size, I meant this: my characters are a specific size (small) and there is no room on the current images to draw a ground shadow. So, I could take the images into GIMP and then put them on a larger canvas, then draw the shadow on that canvas (because I'll have more space on the image to do it since I've put the image on a larger canvas).

I have a question for you: if I were to break each direction down by angle, would I be able to just attach a drawn image (shadow) to the main drawn image (character) in events? So, when the character moves to, say, 45 degrees the ground shadow does the same, etc.? My only concern however, is that the shadow may not move smoothly in each direction... I mean, it may look like a lot of frames are being skipped.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Wed May 05, 2010 2:20 pm

*crickets*

in-e-bah-dee? :)
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Wed May 05, 2010 10:38 pm

That would depend on how you are moving the shadow caster, and how many angles your allowing it to use. You can avoid "extra" angles by setting the number of directions in preferences.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Thu May 06, 2010 2:27 pm

^^^ Thanks for the info. I'm going to try that and report back soon.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests