How do I fix this problem?

Get help using Construct 2

Post » Fri May 29, 2015 5:12 pm

So first the problem, as per line 50 in the below image whenever I go to the next layout (level 2) then starts with nothing but the player and a very basic level layout, no enemies, nothing! However the timer and health (set as an instance variable rather than a global one) both reset fine, hence as per lines 47 to 49 I can not see what after 3 seconds is causing it to go the game over layout screen? Something is destroying my player but I can not figure out which line of code? I have tried deleting and adding in all sorts? I have a theory that somewhere in the code its causing my Global variable Timer and my instance variable PlayerHealth to go from current state in Level 1 to New state in Level 2 which is 100 and then changes to ZERO somehow hence destroying my player and sending me to the gameover screen which should only be happening when the timer reaches zero or the playerhealth reaches zero. I have been at this 5 hours trying to figure out whats wrong is driving me insane.

Image

Image can be viewed at: http://picpaste.com/pics/Jm8VNF2f.1432920448.png
B
10
S
3
Posts: 109
Reputation: 1,080

Post » Fri May 29, 2015 6:28 pm

Maybe next layout is GameOver_Screen? Last line in your image.
B
9
S
3
G
3
Posts: 36
Reputation: 2,433

Post » Fri May 29, 2015 6:43 pm

I must say there are a lot of things I don't understand about your event-sheet..

Do you use this same event sheet for all layouts?
If not where is the event sheet for the layout where things go wrong?
Why are there different bullets for all directions?
Why is there an enemy updown and an enemy sidetoside, who look like they use the same image, only turned?
Why are there so many exactly the same actions, wouldn't using "or" blocks or functions be much better?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri May 29, 2015 6:59 pm

Roal465: No it is definitely not, Level 2 is.


LittleStain:

Do you use this same event sheet for all layouts? No only when the events are similar e.g. levels 1 to 3 have the same events in them just different level layouts.

If not where is the event sheet for the layout where things go wrong? I do not understand what you mean by event sheet for things going wrong?

Why are there different bullets for all directions? Because that was necessary for my gameplay that I was aiming for.

Why is there an enemy updown and an enemy sidetoside, who look like they use the same image, only turned? Because one shoots out left and right and the other shoots up and down.

Why are there so many exactly the same actions, wouldn't using "or" blocks or functions be much better? What do you mean specifically by same actions. I have no idea what or blocks are in terms of construct 2 events.
B
10
S
3
Posts: 109
Reputation: 1,080

Post » Fri May 29, 2015 7:33 pm

I don't want anyone to fix my entire code, I am still a beginner here, just looking for some guidance on what is wrong exactly?
B
10
S
3
Posts: 109
Reputation: 1,080

Post » Fri May 29, 2015 7:52 pm

Well it seems I don't understand anything..
The bullets seem the same image, the enemies seem the same image, the different walls seem the same image..
There seems to be no need to use seperate events with (almost) exactly the same actions attached..
For me it makes the event-sheet unreadable..
And when I can't read the sheet, I can't find the issue..

Are you sure nothing is either overlapping or colliding with the player in the new layout?
Would it help to set Timer to 40 before the wait action?
Or add a wait 0 action after setting Timer?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri May 29, 2015 7:55 pm

Problem can be in your event sheet for 2nd level.
Do you use same event sheet in your 2nd level? Maybe initial value for player hp is 0 and you forget to add to that new event sheet on start of layout set player hp to 100?
B
9
S
3
G
3
Posts: 36
Reputation: 2,433

Post » Fri May 29, 2015 8:01 pm

LittleStain:

Well it seems I don't understand anything.. Nah my event sheet is beginner, I would appericiate if you could show me or point me in the right direction of how to layout a construct 2 project?

The bullets seem the same image, the enemies seem the same image, the different walls seem the same image..
There seems to be no need to use seperate events with (almost) exactly the same actions attached..
For me it makes the event-sheet unreadable..

I agree with you on this hence the above question, I think I need to create seperate event sheets and seperate items to avoid less conflicts.


Would it help to set Timer to 40 before the wait action? Tried this and it had no effect.

add a wait 0 action after setting Timer? Done this and it had no effect.


Roal465

I am using same event sheet. Initial value for player health is 100 and I set it to 100, could that be where its going wrong?
B
10
S
3
Posts: 109
Reputation: 1,080

Post » Fri May 29, 2015 8:07 pm

I think I am going to tidy up my code on Level 1 and make it less conflicting then do a seperate event sheet for each level.
B
10
S
3
Posts: 109
Reputation: 1,080


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests