How do I finish my game?

Get help using Construct 2

Post » Mon Apr 04, 2016 12:15 am

Hi everyone! I am new to the Construct 2 community and just have a few questions. I have nearly finished my game but there are still a few more things that I can't seem to work out.

1) How do I make the game go to a win screen if the players score is high enough and similarly to a lose screen if the player score is too low. The game ends when the player goes through a door but I don't know how to do it from here.

2) One of the mini-games in my game is having the player pickup a rubbish bin and collect falling objects. I can only seem to pin the bin to the player's image point which is beneath her. How do I make it so that the bin is pinned above her?
B
4
S
1
Posts: 11
Reputation: 316

Post » Mon Apr 04, 2016 12:39 am

1) I assume there's a global variable with the score. Create 2 layouts, the win screen and the lose screen.

Add a 2 subevents to the player going through the door event:

Subevent 1

Condition : System ->Compare variable -> score < [minimum success value]
Action: Go to layout [Lose Screen]

Subevent 2

Condition : System->Compare Variable -> score >= [minimum success value]
Action: Go to layout [Win Screen]

2) That's just a simple z order issue. Either right click the bin in the layout and say move to top of layer, or create an event to do the same.

If you upload a capx I'll be happy to help you out if this wasn't clear.
B
23
S
4
G
1
Posts: 71
Reputation: 8,346

Post » Mon Apr 04, 2016 12:59 am

Thank you so much! You solved my first problem and I can now get it working. I still can't work out the bin thing.

I don't think I explained it properly the first time, sorry. I am trying to attach the bin above the player's head on collision with that bin.

In my events, all I have is player on collision with bin. I don't know where to go from here and the player only has an origin point as I don't know how to work image points.

Also is it possible to get him to put it down after a certain time period?

Thanks again. :D
B
4
S
1
Posts: 11
Reputation: 316

Post » Mon Apr 04, 2016 1:20 am

Honestly, imagepoints are probably the easiest way to achieve that. But if you want to avoid it the you could say

on collision with bin:

Action 1

bin -> set position -> x: player.x, y: player.y-((player.height+bin.height)/2)

Action 2

bin -> pin to player


Without seeing the game, it's hard to say how best to approach dropping it after a fixed time. I don't like using "wait" commands but you could add a blank sub event with the actions:

Wait "x" seconds

Unpin bin

You'll probably have to set a position, something like set y: self.y+((player.height+bin.height)/2) but without seeing it it's hard to say.


Or use a timer, add a timer behaviour to the player. Then add a third action to the on collision with bin event saying start timer -> "drop" x seconds.

Then a new event Player -> on timer -> "drop".....

Actions:

Unpin bin

set y: self.y+((player.height+bin.height)/2)


Sorry this is messy, hopefully it helps.
B
23
S
4
G
1
Posts: 71
Reputation: 8,346

Post » Mon Apr 04, 2016 2:03 am

Again... thank you! It is all working now. There is just one more thing.

I am trying to get items to drop down upon the player colliding with the rubbish bin. At the moment I have player on collision with bin set bullet angle to 90 (I added a bulled behaviour to items) & rubbish bin on collision with item add points and then destroy.

Any idea of where to go from here?
B
4
S
1
Posts: 11
Reputation: 316


Return to How do I....?

Who is online

Users browsing this forum: jkmalau and 15 guests