animation bug?

Get help using Construct 2

Post » Sat Sep 16, 2017 4:19 pm

dop2000 wrote:You need to save your project as a single file (.capx) and share this capx file. Not the .caproj file.

Did you add Player and Explosion to the same container? Don't do it. If you destroy one object, all other objects in this container also get destroyed.


okay let me do that
B
7
S
2
Posts: 105
Reputation: 889

Post » Sat Sep 16, 2017 4:26 pm

Message: OBLIVION can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
https://drive.google.com/file/d/0B_wGtoNKF4qgeGhhT0hYUnN1U1U/view?usp=sharing
B
7
S
2
Posts: 105
Reputation: 889

Post » Sat Sep 16, 2017 5:24 pm

Man, this took me almost 30 minutes to figure out... And now I feel stupid because the answer was really simple.
When you are checking if "Health=0" you should add another condition "System->Trigger once". Or make "Health" an instance variable of Player object, as you did with enemies.
Otherwise this condition triggers again and again even after your player is destroyed. And your Explosion and GameOver sprites are moved to (0,0) because the system can't find (Player.X, Player.Y)
Check out my awesome game Doptrix
B
17
S
9
G
51
Posts: 835
Reputation: 28,479

Post » Sun Sep 17, 2017 8:56 am

dop2000 wrote:Man, this took me almost 30 minutes to figure out... And now I feel stupid because the answer was really simple.
When you are checking if "Health=0" you should add another condition "System->Trigger once". Or make "Health" an instance variable of Player object, as you did with enemies.
Otherwise this condition triggers again and again even after your player is destroyed. And your Explosion and GameOver sprites are moved to (0,0) because the system can't find (Player.X, Player.Y)


WOW this actually worked. i didn't see that before. thank you very much mate
B
7
S
2
Posts: 105
Reputation: 889

Post » Sun Sep 17, 2017 9:39 am

okay so i have another question. whats the easiest way to change the appearance of one sprite into another by collision? for example, my player walks into the object and then player becomes that abject. ive looked at the animation way buy seems complicated also perhaps spawn but yet still not 100%
B
7
S
2
Posts: 105
Reputation: 889

Post » Sun Sep 17, 2017 10:59 am

Since your player has only one animation frame, you can set animation speed to 0 and add another frame.
To change Player's appearance on collision with another object, just change its animation frame.

Or if the object you are talking about is something like a new gun or a helmet, you can use Pin bahavior to attach it to the Player. Define different image points on the Player sprite where you will pin different items.
Check out my awesome game Doptrix
B
17
S
9
G
51
Posts: 835
Reputation: 28,479

Post » Sun Sep 17, 2017 4:14 pm

worked perfectly.
B
7
S
2
Posts: 105
Reputation: 889

Post » Sun Sep 17, 2017 4:36 pm

okay so i have another issue. when i touch the the object and change to shotgun the player changes but how do i then stop the previous bullets and spawn new ones from image point 2. problem is the image point 2 is on the shotgun frame not the player frame. any ideas?
B
7
S
2
Posts: 105
Reputation: 889

Post » Sun Sep 17, 2017 5:55 pm

To stop previous bullets - you can destroy them. However, since they are already fired, why bother?

Is shotgun a separate object that you pin to the Player sprite? You can create a new image point on the Player for shotgun bullets. Or you can spawn bullets from the Shotgun object.
Check out my awesome game Doptrix
B
17
S
9
G
51
Posts: 835
Reputation: 28,479

Post » Sun Sep 17, 2017 6:41 pm

how do you pin the object? current;ly its a sprite and when you collide with it the player equips it (on different frame) same player but different frame so its all one object. the only difference is the shotgun powerup is seperate
B
7
S
2
Posts: 105
Reputation: 889

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: irina and 25 guests