[Fixed] Animation in top left corner of the screen

Get help using Construct 2

Post » Thu Jun 29, 2017 7:25 pm

I have an animated explosion sprite created on an enemy sprite just before it's destroyed and the animation is created where it's suppose to be, but it's also created in the upper left hand corner of the screen (x0,y0). Anyone know the reason for that? It seems to happen randomly.
Last edited by Moot on Tue Jul 04, 2017 3:14 pm, edited 1 time in total.
B
16
S
7
Posts: 190
Reputation: 1,823

Post » Thu Jun 29, 2017 7:50 pm

Hi,

There must be something in your events that is responsible for it. What you can do is use the SEARCH ability in C2 on top and write there EXPLOSION (or whatever the name is) and it will show you all the lines which have that. And then all you have to do is read those and find where it says 0,0
Thank you to Construct 2 for giving me the ability to create games without programming knowledge.

My games & gaming portal = DolyGames

If anyone wants to cooperate to help each other Win-Win please email me - I am always happy to discover new opportunities.

Cheers,

COSMOS
B
20
S
9
G
1
Posts: 75
Reputation: 2,152

Post » Thu Jun 29, 2017 9:17 pm

DolyGamesCosmos wrote:Hi,

There must be something in your events that is responsible for it. What you can do is use the SEARCH ability in C2 on top and write there EXPLOSION (or whatever the name is) and it will show you all the lines which have that. And then all you have to do is read those and find where it says 0,0


Thanks for the reply. I'm only using it in 2 events. The explosion animation is destroyed 'On Start' event and then 'Create object' on layer3 at (enemy.X, enemy.Y). It's also pinned to the enemy sprite once it's created and destroyed 2 seconds later. It's not used anywhere else.

I'm thinking the hiccup has to be caused by something else. Is 40 actions too much for an 'On Start' event? Most of the actions in the event are destroying sprites and setting variables back to 0. Maybe 67 events is too much for an HTML5 game?
B
16
S
7
Posts: 190
Reputation: 1,823

Post » Sat Jul 01, 2017 3:35 pm

No, I don't think so, i have games with tons of events.

Your explosion cannot just appear on 0,0 by itself. It has be be told somewhere to appear there. So you have to find where your design mistake is.

Also, you shouldn't have objects you don't need in your layout and then having to destroy them on start. That's not efficient and waste of time. Create a separate layout called OBJECTS and dump all your objects there. And in your game layouts use only objects that you need ideally created via events and not physically put there.
Thank you to Construct 2 for giving me the ability to create games without programming knowledge.

My games & gaming portal = DolyGames

If anyone wants to cooperate to help each other Win-Win please email me - I am always happy to discover new opportunities.

Cheers,

COSMOS
B
20
S
9
G
1
Posts: 75
Reputation: 2,152

Post » Mon Jul 03, 2017 7:50 pm

DolyGamesCosmos wrote:No, I don't think so, i have games with tons of events.

Your explosion cannot just appear on 0,0 by itself. It has be be told somewhere to appear there. So you have to find where your design mistake is.


I know that I didn't create a sprite on 0,0 because I would remember doing it and the search feature in C2 only came up with 2 events, neither of them show it being created in the top left corner. Also it happens randomly. If there was an event to specifically create it in the corner, then it would be created every time. This has happened to me once before about a couple years ago, but I forgot how I fixed it. I was just curious if someone else also had experience with it. I'll figure it out...

DolyGamesCosmos wrote:Also, you shouldn't have objects you don't need in your layout and then having to destroy them on start. That's not efficient and waste of time. Create a separate layout called OBJECTS and dump all your objects there. And in your game layouts use only objects that you need ideally created via events and not physically put there.


Thanks, but it's a single layout game. Adding another layout for objects would not be efficient. And there are reasons the objects are destroyed on start. Most of them have looping animations and I don't need them to be playing all the time, and there's no reason for them if they aren't being used.

Thanks again though.
B
16
S
7
Posts: 190
Reputation: 1,823

Post » Mon Jul 03, 2017 9:46 pm

Share the project.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon Jul 03, 2017 10:44 pm

Just trying to say simply that things never just appear by themselves. Somewhere it is written that it must appear at 0,0

I think it is not possible to continue further without seeing more details, so as 99Instances2Go suggested people will have to see your project to advise further.
Thank you to Construct 2 for giving me the ability to create games without programming knowledge.

My games & gaming portal = DolyGames

If anyone wants to cooperate to help each other Win-Win please email me - I am always happy to discover new opportunities.

Cheers,

COSMOS
B
20
S
9
G
1
Posts: 75
Reputation: 2,152

Post » Tue Jul 04, 2017 2:04 am

If it's not created there perhaps it's moved there elsewhere in events?

Actually thinking about it. this action here:
'Create object' on layer3 at (enemy.X, enemy.Y)

can create at 0,0 if there are no enemy instances to get a value from.
B
92
S
32
G
107
Posts: 5,274
Reputation: 69,959

Post » Tue Jul 04, 2017 3:12 pm

R0J0hound wrote:If it's not created there perhaps it's moved there elsewhere in events?

Actually thinking about it. this action here:
'Create object' on layer3 at (enemy.X, enemy.Y)

can create at 0,0 if there are no enemy instances to get a value from.


Ah, that was it! I guess the events were cycling through a little too fast, but adding a slight 'wait 0.1 seconds' after the explosion sprite is create and pinned to the enemy, and before the enemy sprite is destroyed seemed to have fixed the problem. That's why you are the forum genius! I definitely need to make a note of that for next time.

Thanks for solution, R0J0hound. :D
B
16
S
7
Posts: 190
Reputation: 1,823


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, Krakcz, marcinkowski, R0J0hound, tarek2 and 14 guests