How do I fix this problem?

  • 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 can be viewed at: http://picpaste.com/pics/Jm8VNF2f.1432920448.png

  • Maybe next layout is GameOver_Screen? Last line in your image.

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

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

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

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

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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?

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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)