A couple of questions

Get help using Construct 2

Post » Wed Jan 29, 2014 1:24 pm

Hi guys,

I have a couple of questions from sketching out my initial game idea.

1. I have it set so when the user clicks on an 'enemy' sprite it is destroyed. How do I include a 'radius' effect so any enemy sprites in the radius are destroyed? And can I create a circle radius around the mouse cursor when this is enabled?

2. How are in-app purchases handled/set up? Is there any tutorials available? This is later down the path but want to get an idea now of what is needed/required.

3. How do I apply visual effects to sprites? I have a spaceship and when the user collides with a shield powerup I want to apply a blue glow around the outside of the ship sprite.

4. How can I randomize the image point of a large sprite? Say I have a mothership and it can spawn a missile sprite from one of three turrets. Is it as simple as saying 'Spawn [object] on layer 0 [int(image point 1, image point 3)? Or do I have to call a random integer between 1 and 9, and assign image point 1 to 1-3, image point 2 to 4-6 etc?

5. I have a bomb, and I want to destroy all instances of 'enemy' sprite when the user activates it. How would I go about that? I still want new ones to continue coming though.

6. If I have a bucket sprite and I want to destroy a sprite that touches it, ie. 'collect' the sprite and increase a variable by 1, can I set it so that if the sprite collides with the edges of the bucket along the top it's destroyed but the variable only goes up if it collides with the middle part of the bucket. Like in real life if an item hits the rim of the bucket it won't go in...

7. I know very little about Construct's particle systems. Is it possible to set a 'smoke screen' effect on a certain region of the layout, and set its opacity and duration?

8. On regions, can I assign certain regions like a hotspot or would I have to create an invisible box sprite and set collision for it?

9. And finally, how can I set an 'achievement' of destroying x number of 'enemy' sprite before any of them hit the player? I'm thinking (guessing) it would have something to do with increasing a killinarow variable that increases with every successful mouse click destroy event but resets when playerhealth variable is decreased upon enemy sprite colliding with player? Am I close?

Thanks heaps! Learning lots about the system!
B
5
S
1
Posts: 44
Reputation: 465

Post » Wed Jan 29, 2014 1:40 pm

Problem with having so many questions is I can't answer them all, so I'll just pick a few.

1 - use the distance() expression to pick enemies within a certain distance.

4 - I think using choose() would work here, with this you can even make one imagepoint be preferred to another.


5 - On bomb explode pick all enemies - destroy. or if you only want enemies within a certain distance of the bomb, you could again use the distance() expression.

6 - easiest way I can think of is having a seperate collision-sprite to check if the top is collided with.

8 - if the regions are square, you could check the x and y positions of objects against the top and bottom y and left and right x of the region.

9 - Something like that should work

Good luck!
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 » Wed Jan 29, 2014 3:11 pm

1) you've pretty much described what to do. Make a circle sprite, and set it's position to the mouse every tick. On click, check the 'Is overlapping' condition.

3) this particular effect doesn't exist yet. There is a thread on it. The simplest thing to do is to draw your own glow and display it as needed.

7) there are threads discussing smoke effects.
ImageImageImage
B
71
S
21
G
231
Posts: 3,695
Reputation: 129,366

Post » Wed Jan 29, 2014 3:33 pm

Thanks for filling in the blanks, @blackhornet
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 » Thu Jan 30, 2014 10:31 am

Thanks guys, very useful information.

1. a) Can pin be used to pin a sprite to the mouse location? I was thinking of making it invisible then showing it when the left mouse button clicked. Otherwise I can just create it at mouse X & Y when the button is clicked.

1. b) How would I use distance() to destroy all instances of sprite 'enemyship'?

3. Thanks for the update. would you have the link to the thread @blackhornet so I can keep up to date.

4. Would you have an example of how to use choose()?

5. Thanks heaps, that works perfectly!

6. Thanks I can do that, just thought it would be cool if we could specify the exact area of the main sprite

7. Thanks, I'll have a look for that

8. Thanks for that!

Thanks heaps guys!
B
5
S
1
Posts: 44
Reputation: 465

Post » Thu Jan 30, 2014 12:17 pm

1. a) Can pin be used to pin a sprite to the mouse location? I was thinking of making it invisible then showing it when the left mouse button clicked. Otherwise I can just create it at mouse X & Y when the button is clicked.

You could just use:

system every tick
- sprite set position : mouse.x, mouse.y

1. b) How would I use distance() to destroy all instances of sprite 'enemyship'?

On mouse clicked
For each enemyship
system compare two values : distance(mouse.x,mouse.y,enemyship.x,enemyship.y)<200
- enemyship destroy

4. Would you have an example of how to use choose()?

system every x seconds
- enemy spawn bullet : imagepoint = choose(1,2,2,3,3)

6. Thanks I can do that, just thought it would be cool if we could specify the exact area of the main sprite

I'm not sure what you mean by exact area of the main sprite
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 » Thu Jan 30, 2014 3:40 pm

ImageImageImage
B
71
S
21
G
231
Posts: 3,695
Reputation: 129,366


Return to How do I....?

Who is online

Users browsing this forum: Lancifer and 60 guests