2 questions

For questions about using Classic.

Post » Fri Nov 21, 2008 10:24 am

First Question:

Is it possible to set few light sources with Bumpmapping?

in example. I have a ground floor and few characters shooting some fancy sci-fi glowing bullets from their awesome futuristics guns (lol) and i would like to effect bumpmapping of that floor everytime when the bullets flying across the screen. And now, do i have to use single sprite with bumpmapping for a single bullet (like when bullet is out, create new sprite with bumpmap, trace light position to bullet position,when bullet is destroyed destroy sprite with bumpmap)?
Or maybe thers is some other, easier (more human) way for that effect?

Second Question:

I'm tring to make my enemy character made of 3 sprites (legs, torso, head) so you can choose on witch body parts you want to shoot him.
I think i make him move in only one direction so the movement and animation are pretty obvious.
I know who to position those body parts to "one body" (move them all as one), but how can make many copies of that enemy? so each "body parts" belong to current "body?

I know (i think) i have to use spread value, but honestly i can't make it work for me....

best regards for all
Last edited by shinkan on Fri Mar 11, 2016 3:24 pm, edited 1 time in total.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Fri Nov 21, 2008 10:56 am

First: I'm not quite sure how bumpmapping works, but if you pass in it such parameters like X light and Y light, then you should count these values as a mean value of X positions of all bullet objects (and the same goes for Y).

Second: Use container, it's made to making few objects referencing to each other when at least one of them is chosen.
More info:
[url:ywhxmn3b]http://apps.sourceforge.net/mediawiki/construct/index.php?title=Containers[/url:ywhxmn3b]
B
6
S
3
G
6
Posts: 219
Reputation: 3,013

Post » Fri Nov 21, 2008 11:21 am

Spread Value is an MMF function. Construct doesn't use or need it because the instance picking in Construct is much more in depth.

Anyway BROO is right, you need to use Containers if you have multiple enemies that are each made of different parts. When you have three things in a container, picking one of those things will automatically pick the other two things in that container along with it.

Well, you don't actually need to use containers, but it makes things a lot easier :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Nov 21, 2008 3:14 pm

[quote="shinkan":22yv3sjd]Is it possible to set few light sources with Bumpmapping?[/quote:22yv3sjd]
Hmm, maybe... the method you described might work, but I'm not sure it'll get the angle of the highlights to correlate to the position of the bullet lights. As for creating and destroying lights with bullets, that's easy - just put the lighting sprite in a container with the bullet object. Since 'Create' and 'Destroy' actions create and destroy the whole container (see the article BROO linked) then the creation and destruction of the lighting sprite is taken care of automatically.

[quote:22yv3sjd]Second Question[/quote:22yv3sjd]
Definitely containers for this one, again see the article. But you never ever need to use the spread values paradigm in Construct! Not only does it make for horribly messy events, its algorithmic efficiency is appalling as well, and Construct has much better alternatives. It might take you a bit of extra effort to learn how to do it in Construct, but it is definitely worth it. For example:

+ Start of layout
-> Spread value 0 in Sprite
-> Start loop "blah" Sprite.Count times

+ On loop "blah"
+ Sprite value = loopindex("blah")
-> Actions to perform on Sprite individually

This can succinctly be rephrased in Construct as:

+ For Each Sprite

It's quicker, easier, neater, and runs a hell of a lot faster too :P
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Mon Nov 24, 2008 10:00 am

ha! my mistake i was reading some articles about mmf before and thats why i wrote "spread value".

thanks for all

i done a quick test last night to create few bullets and bumpmaps at same time and...well...it was so bright :D
looks like all sprite with bumpmaps multiples and make one bright effect, propably adding some masks to ewach sprite (to make only small piece of that sprite visible) could help...needs more testing ;>

and for the second part.

"For Each Sprite" - looks much more reasonable :D
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests