Game problem. Can't find the solution

Get help using Construct 2

Post » Wed Jun 17, 2015 9:33 pm

You may have seen something similar in previous posts. I have brought aspects of the game to the forum a few times but i'm struggling a lot on this one issue that i can not seem to solve, even with the suggestions people have offered.

Basically I have a game where a square has a different colour on each side of the square. The square then rotates to the oncoming enemies to match up the colour of the side with the colour of the enemy......simple.

The problem i'm having is only after exporting the project. On the computer everything runs smoothly but after exporting the project through android(into intel xdk) or through cocoonJS the results are the same. The problem is...........

when the enemy collides with the same colour side, it gets destroyed. When it gets destroyed it freezes for a split second, making the game look very un-smooth because of it.

If you have any idea why this might be happening i can always send over a image of the capx to try and help. I should note the following in case it is relevant

- all the images are small size so that can't be much of an issue
- i've exported using intel xdk and cocoonjs, which both had the same issue (cocoonJS was slightly better).
- when the enemy collides 4 events happen
(1) A noise i made
(2) 1 is added to the score
(3) enemy destroyed
(4) Sub event > "is animation playing" > "enemy 1"
- enemy speed increases every 1 seconds

just to show that not a whole great deal happens when the enemy gets destroyed so it isn't processing excessive amounts

Thank you so much!!!!!!!!!!!
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Wed Jun 17, 2015 11:06 pm

Was sub event placed after enemy destroyed? If that true then it is not the correct way to code.
ImageImage
B
102
S
45
G
22
Posts: 772
Reputation: 21,493

Post » Thu Jun 18, 2015 2:01 am

@alextro is this incorrect

Image
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Thu Jun 18, 2015 4:15 am

Uh I don't know what you want to do with local/web-storage as a condition to play a sound fx.

Would be better if score occur after those Ninja destroyed (Ninja on destroyed >> add 1 to score). With your current condition the score will not store the value correctly especially when more Ninjas collide with a "color" box at the same time. Trust me I made some test!

So you can safely placing sound fx & score after 'Ninja on destroyed'. But make sure set text to score after add 1 to score, or simply separate the text action under 'every tick' condition.
ImageImage
B
102
S
45
G
22
Posts: 772
Reputation: 21,493

Post » Thu Jun 18, 2015 4:59 am

After fixing this issue, you can turn these 2 event in one. Simply making the Green and Blue into one object, and adding two animations: "Green and Blue". Then, add an instance variable called "Color" (as example). In each object, you can write her own variable (Blue and Green). Then, in the event "On start of layout", add an action "Set animation to [OBJECT].Color (the instance variable) " Then, on start of layout, the object will appear of the color that you've choose. And, add one OR block with these conditions "On collision with [OBJECT]". Above this event, you can "pin" the condition: "Is animation [OBJECT].Color is playing". Simple to have these 2 events into one! :D
My Bitcoin address: 1NG9VKTZzA3patBrWySA4qRWcuKyYkhtfc
B
23
S
7
G
4
Posts: 320
Reputation: 3,839

Post » Thu Jun 18, 2015 12:09 pm

@alextro The reason i have the local web storage for the sound is because i have a mute button so that when the game is closed down and re-opened, the volume will not reset.
I'm a bit confused on how you're saying I should re code it?? To drag the 3 events on the right down to the sub event(is animation playing)?

@DanielMesquita Its currently an array so the enemies are from one sprite with 4 different animations (see image below)
The name of the sprite should be "ninjas" so don't be put off by it saying blue

Image
B
8
S
2
Posts: 146
Reputation: 1,132

Post » Thu Jun 18, 2015 4:09 pm

This is what I'm trying to say:
Image
ImageImage
B
102
S
45
G
22
Posts: 772
Reputation: 21,493

Post » Fri Jun 19, 2015 12:49 am

@alextro thanks so much. I will try it out this weekend and get back to you!
B
3
Posts: 36
Reputation: 253

Post » Fri Jun 19, 2015 1:52 am

Very better, @alextro ! :D
My Bitcoin address: 1NG9VKTZzA3patBrWySA4qRWcuKyYkhtfc
B
23
S
7
G
4
Posts: 320
Reputation: 3,839

Post » Tue Jun 23, 2015 3:32 am

@alextro Hi I did exactly what you said and it still seems to be jumpy. If it's not when the object is destroyed what could it be? When it's created?
B
8
S
2
Posts: 146
Reputation: 1,132

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests