My ongoing list

New releases and general discussions.

Post » Sun Mar 08, 2009 2:14 pm

@30 Detector Cone: Can be done with Dist(x1,y1,x2,y2) and angles.
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Sun Mar 08, 2009 2:16 pm

And obstacles?
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Sun Mar 08, 2009 2:20 pm

[quote="Mipey":3a0odwmg]And obstacles?[/quote:3a0odwmg]
Hmm well then add "Line of Sight" behavior and you have Cone Detector.
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Sun Mar 08, 2009 2:23 pm

And it'd still be a bitch to adjust the cones dynamically for each enemy type. A cone detector behavior where you could directly modify the cone and where the obstacle stuff is in there (my guess is that you shoot a vector and if the vector hits a solid, it stops detection from that point on) without me having to do workarounds would be neat. You could use them for most genres anyway, whether it's top-down or a sidescroller, it just makes sense.
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Mon Mar 09, 2009 11:22 am

[quote="thomasmahler":3a7zgxem]31) fsck the idea with my 'level sheets' - that's a load of crap. We can just organize everything in folders. I created a quick mockup:

[/quote:3a7zgxem]

I really like this one, I'll see what can be done.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sun Mar 22, 2009 5:43 pm

34) I'm currently trying to create an 'Attack' event and I'm wondering how we'd best set this up. Currenly, my setup looks like this:

On collision between Player and EnemyFamily
is global variable 'Attacking' Equal to 1
= enemy: subtract 5 from 'HP' (which is a private variable for each enemyType)

EnemyFamily: Value 'HP' Equal to 0
= EnemyFamily: Destroy

And that sorta works. Now, the problem comes with the collisions themselves. How would I define that only the pixels of the sword actually hurt an enemy - and not the whole playerSprite?

It'd be really cool if we could create a collision layer for each sprite in the PictureEditor that we could then trigger for events. So for my character, I'd create a collision layer for the 'Attack' Animation and color in all the pixels of the sword. Then I'd name that layer something like "Swordmask"

Then the event would be:

On collision between Player.Swordmask and Enemy Family... etc.

Or is there an easier way to set things like that up that I just don't know of?
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Sun Mar 22, 2009 5:52 pm

Using a separate invisible sprite as a collision mask is the usual way to go about that.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sun Mar 22, 2009 6:54 pm

Just found out that if you set the collision model to be 'per pixel' and you scale the sprite in the layout editor, the 'per pixel' stuff is still being based on the 1:1 sprite.

Wouldn't it make more sense to base it off of the actual pixels of how the sprite is being drawn at runtime?
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Sun Mar 22, 2009 6:55 pm

Yes it would, that's a bug that should be reported.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Mar 22, 2009 11:09 pm

What??? It definitely shouldn't be doing that - I definitely wrote it to scale and rotate collisions too. Submit a bug report!
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

PreviousNext

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests