How do I create a sprite at a minimun Y of another one

Get help using Construct 2

Post » Tue Jul 21, 2015 7:44 am

Hi all!
I wonder how do I create a Sprite at a minimum distance of another one, I have a vertical sprite where the smaller sprites should be created (so same X for all of them but different Y) and they need to be at a minimum of 100px (or some) in Y axis
I tried creating an invisible sprite at imagepoint 0 to make an "aura" where the next sprite cant be placed, but when i have to many sprites in an android device it lags a lot

Thanks!
B
22
S
9
G
4
Posts: 66
Reputation: 3,775

Post » Tue Jul 21, 2015 9:46 am

try something like:

vertical sprite ; spawn small sprite (this will create a new copy of the small spite at the location of the vertical sprite)
small sprite ; set y to self.y+100
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,832

Post » Tue Jul 21, 2015 9:57 am

that's the problem, I can not create too many sprites because of the performance
B
22
S
9
G
4
Posts: 66
Reputation: 3,775

Post » Tue Jul 21, 2015 10:12 am

the player is the white circle, who is supposed to go throught the black sprite verticaly but when I draw a line between two black sprites and the player collides with the line, the player changes his angle and follows the line, and then back to the black sprite angle to go up again.

Image
Image

The matter is that in android devices (where the game runs not as fast as in computer) sometimes the player ignores the line and keep going upward (I suppose its because of a little "lag jump")
Any way to fix it? I think by increasing line.width...

Thanks again and excuse my english
B
22
S
9
G
4
Posts: 66
Reputation: 3,775

Post » Wed Jul 22, 2015 9:34 pm

Bump
B
22
S
9
G
4
Posts: 66
Reputation: 3,775

Post » Thu Jul 23, 2015 5:23 am

you could also just alter the size of the lines collision polygon

or

you could store the positions of where you have touched on the vertical line (in an array ?) and when the player is over/close to these positions then alter the players angle...
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,832


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests