0 Favourites

[Fixed] Animation in top left corner of the screen

  • 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.

  • 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

  • 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?

  • 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.

  • 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...

    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.

  • Share the project.

  • 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.

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

    Actually thinking about it. this action here:

    [quote:2401q0et] '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.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • If it's not created there perhaps it's moved there elsewhere in events?

    Actually thinking about it. this action here:

    [quote:32f7gi9a] '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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
1,941 263,192
FlyingRam's avatar
FlyingRam
Unread hot topic
175 32,627
clifton11221's avatar
clifton11221
Unread hot topic
98 7,591
norum82's avatar
norum82