How do I spawn BULLETS allways from the same image point?

Get help using Construct 2

Post » Fri Aug 25, 2017 4:18 pm

hi in my game i have something weird happening

when i star the game if the player push X the the sprite bullet is spawn from the "player" at image point 0 "center" by default.

PROBLEM IS it only happens when the player respawn, every time i start the game with my firs life the bullets are created somewhere from the ground where the player is.

when i die once, then the bullets are created from the sprite image point "0"

do someone know that problem???
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Fri Aug 25, 2017 4:23 pm

This can be easily resolved with a shared capx. Without it, just guesswork.
B
47
S
17
G
82
Posts: 2,230
Reputation: 48,607

Post » Fri Aug 25, 2017 4:25 pm

this what happens when i start the level and then i fire bullets are created fron anywhere from the ground
https://s2.postimg.org/4ivzttzhz/err01.jpg

when i die fist time bullets spawn from center of my player its correct
https://s2.postimg.org/9vku7ynef/err02.jpg

and here its my code
https://s2.postimg.org/mo8y7vz09/err03.jpg
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Fri Aug 25, 2017 4:49 pm

SOLVED, it was because the sprite object was on layer 1 and in the spawning code i set to layer 0

this is a good thing to know.... !
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Fri Aug 25, 2017 5:07 pm

NOT SOLVED , when i die now the bullets respawn from the top of my sprite... :s wtf is this...

i use the load & save state from construc 2 i seriously THINK this has something to do with that problem.
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Fri Aug 25, 2017 5:22 pm

SOLVED i added, reset layout when player dead+respawn and everything is fixed now!
B
39
S
16
G
7
Posts: 1,727
Reputation: 9,865

Post » Fri Aug 25, 2017 5:46 pm

Little nit weird way to solving this small problem, but when it works, it's good! :)
SoftWork Group Ltd

Co-founders:
Robert Matik (UK Division)
Lukas Zyrek (CZ Division)

07399443703 (UK Division)

International(at)softworkgroup.wtf - for basic questions and information
Office(at)softworkgroup.wtf - email for questions about team and proposals
B
16
S
5
G
1
Posts: 49
Reputation: 1,656


Return to How do I....?

Who is online

Users browsing this forum: maranpis, totoe and 33 guests