How do I color the background?

Get help using Construct 2

Post » Thu Jul 24, 2014 10:51 am

hello to everyone, i would like to know how to make a sprite to "paint" the background is own color everytime i move it, the sprite is just a color square who move case by case.
here its a jpg file who show you what im looking for. Image

thanks to all
B
36
S
13
G
7
Posts: 1,648
Reputation: 9,323

Post » Thu Jul 24, 2014 11:38 am

IMHO, never tested before, but it might help: Event => condition: if Paint_sprite on drag condition 2: Paint_sprite is not colliding with Red_paint ==> action: Paint_sprite : spawn "Red_paint" at o.
ImageImageImageImageImage
B
54
S
15
G
5
Posts: 852
Reputation: 11,346

Post » Fri Jul 25, 2014 12:13 pm

another question is, my sprite has 60px in size x-y, how to move the sprite case by case 60px when im draging the sprite on the layer?
B
36
S
13
G
7
Posts: 1,648
Reputation: 9,323

Post » Fri Jul 25, 2014 3:30 pm

@imothep85
If you do something like this:

Code: Select all
Sprite->Is dragging
   Sprite.X = Touch.X - Touch.X%60
   Sprite.Y = Touch.Y - Touch.Y%60

It should only allow the sprite to be dragged in 60px blocks.

If you use Mouse instead of Touch, replace Touch.X & Touch.Y with Mouse.X & Mouse.Y
Vote for all the Construct 2 games on Steam Greenlight - Find them here
B
32
S
9
G
7
Posts: 444
Reputation: 6,731

Post » Fri Jul 25, 2014 4:10 pm

i solved that, thanks bu now i have to tell to the sprite to "stop" when he collide the solid blocks, the player is controlled by keyboard in 4 directions only.
B
36
S
13
G
7
Posts: 1,648
Reputation: 9,323

Post » Fri Jul 25, 2014 6:19 pm

First you were talking about dragging a sprite, now about moving the player by keyboard..
Please explain what is the difference between the sprite, the player and the solid blocks..

Should be something simple as, is overlapping set back to original position, or is not overlapping at offset move to the position, but I don't know in what way your code is set up to do the movement..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jul 25, 2014 6:35 pm

thanks for your help, i found the solution, by activating and deactivating groups who use my customised movement case by case.
B
36
S
13
G
7
Posts: 1,648
Reputation: 9,323

Post » Fri Jul 25, 2014 10:25 pm

Congrats on finding the answers, & good luck on your project! :)
ImageImageImageImageImage
B
54
S
15
G
5
Posts: 852
Reputation: 11,346

Post » Sat Jul 26, 2014 11:39 am

well for painting.........its not working :s
B
36
S
13
G
7
Posts: 1,648
Reputation: 9,323

Post » Sat Jul 26, 2014 12:11 pm

Use sprites with several frames.
I explained this process in this tutorial amongst other things.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,319
Reputation: 87,487


Return to How do I....?

Who is online

Users browsing this forum: ChesVCF, DarknessGamingDK and 2 guests