How do I: Destroy sprites partially?

Just started using Construct 2? Post your questions here

Post » Tue Oct 21, 2014 9:28 am

Hello everyone, I am one of the newest construct 2 users.
My data:
# laptop - Win 7, 64-bit - Intel i5 CPU, M480 @ 2.67GHz - 4GB RAM
# Construct 2, v1.84 (64-bit)
# No programming knowledge

Is it possible to destroy sprites partially?
1) fog of war (black sprite), penetrated by line of sight (white sprite), but remembering what the hero (sprite) has seen
2) a big sprite of earth (solid sprite), then a digger (solid sprite) dig a tunnel through it, leaving the tunnel accessible to other sprites

Because if not, I don't think I can create the game I want with Construct 2... T_T
There may be a workaround for example 1, but not 2 (I think).

Please help! Thanks for reading!
Posts: 2
Reputation: 179

Post » Tue Oct 21, 2014 12:26 pm

im nub at construct 2 but i think its not possible to destroy sprites partially.
2) you can create lots of solid sprite for your earth (just copy paste), the digger can dig a tunnel through it by destroying bits and bits sprites. ... sfarelante

1) lol i dunno what you saying.

i remembered last time i am pro at construct 2 and i did something like a knight holding a sword,
i can easily destroy the sword only and not the knight. (but its more like 2 sprites instead of a total of 1 sprite.)

basically, rather than partially destroying sprites, why not make more sprites and put them besides each other or even pin them together like my knight holding a sword then destroying them separately.

instuctions on how to play on the above link to the game.
(Movement Left Arrow or A and Right Arrow or D.
Jump Up Arrow or W
Bite Ctrl or O or P
Pause ESC
Dash 2x Left Arrow or 2x Right Arrow
Turbo Drill - in the air press 2x Down Arrow
Activate Specials L )
Posts: 87
Reputation: 10,471

Post » Tue Oct 21, 2014 5:48 pm

1. This can be done with either:
a. using a layer with "force own texture" set to yes, a black sprite covering it and sprites with the destination-out blend wherever you want to see through. ... rites.capx

b. Using my Paster plugin to draw to a texture directly. The advantage over A is you can have more of a persistent fog without lots of destination-out sprites. ... aster.capx

2. This can be done with a lot of sprites like foxrain4 said or you can use the tilemap objects for better performance although it becomes a bit more tedious to clear the terrain. A third option is to use my Canvas plugin to access pixel image data directly, but it will require much more effort since you'll have to make your own collision detection and response with pixels since C2's collision and behaaviors only works with polygons. Anyway here's a topic that links to a bunch of useful examples on the topic:
Posts: 5,517
Reputation: 83,472

Post » Tue Oct 21, 2014 10:57 pm

I think you should use "animation frames" draw the images you want in a draw program of your choice and then run them as a animation on trigger. much easier this way. :)
Posts: 147
Reputation: 4,875

Post » Wed Oct 22, 2014 3:36 am

Thanks for all the replies!

I will look in to this the next days and see if I can make it work! Thanks especially to "R0J0hound" for the links.
Posts: 2
Reputation: 179

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests