[SOLVED] Increase bullet speed by X pixels pr object overlap

Get help using Construct 2

Post » Sun Mar 22, 2015 2:21 am

I hope I'm just being stupid here..
Got stuck on what i hope is a simple problem..

What I want is:
Player overlaps selected Sprite = Player speed (bullet) increases by 5 pixels.
It should gain an other 5 pixels in speed on the next overlap, and so on.



Currently the closest thing to this I can think up is to have a variable check on overlaps and set speeds to
    * variable=1"overlap"`=Player set bullet speed 100
    * variable=2"overlap"`=Player set speed 105
    * variable=3"overlap"`=Player set speed 110
    * variable=3"overlap"`=Player set speed 115
But there has to be a simpler way since we're talking a Whooooole lot of overlaps..




Acceleration increases speed ofc, but it keeps accelerating after the overlap as well, which breaks things.

Feel free to dummy it down a bit if you have an advanced answer.
I have no idea what I'm doing usually.

Your's truly, Miss Insomnia..
Last edited by Crazeh on Sun Mar 22, 2015 2:42 am, edited 1 time in total.
-- Because a pig told me to be nice.
B
11
S
2
G
1
Posts: 29
Reputation: 1,327

Post » Sun Mar 22, 2015 2:26 am

on overlapping with player

Action: set speed to Object.bullet.speed+5
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Sun Mar 22, 2015 2:34 am

Not sure how efficient this is, especially for lots of objects, but what about this:
Image
Explanation: If it is overlapping an object, count how many there are. Then add the count of objects to the speed.
@volkiller730 wouldn't that accumulate speed without decreasing it?

Edit: Oh you mean it doesn't decrease? Sorry I misunderstood.
Last edited by Sumyjkl on Sun Mar 22, 2015 2:37 am, edited 2 times in total.
'Good' gameplay is gameplay that gets the effect you want.
Want to make a game with me? Come here!
My example capxs
My Game Art 'Portfolio'
B
31
S
9
G
1
Posts: 135
Reputation: 3,220

Post » Sun Mar 22, 2015 2:36 am

volkiller730 wrote:on overlapping with player

Action: set speed to Object.bullet.speed+5


This works absolutely perfectly :)

This is the last piece in the puzzle and the game is almost done now :)
Thank you!!! <3

:) :) :) :)
-- Because a pig told me to be nice.
B
11
S
2
G
1
Posts: 29
Reputation: 1,327


Return to How do I....?

Who is online

Users browsing this forum: 20170217, Jordan159, Lancifer, pelife123, purefabulousity and 10 guests