How do I do these few things?

Get help using Construct 2

Post » Fri Jun 09, 2017 10:28 am

[img]blob:http://imgur.com/fea492fd-c4b1-4740-aa53-296e6973ea78[/img]

Im working on a multiplayer HTML zombie survival game, but I got many questions, this is the first game iv ever done.

Image

- How do I stop the gun sounds when the player dies? When I click you can still hear the gun sound even tho the player got deleted...
- How do I make zombies not go trough each other? :mrgreen:
Image
- How do I make zombies spawn outside the player's view range? They keep spawning on top of the player lol
- How do I make the map infinite (The player can go into any direction without there beeing a wall)?

Thanks.
B
4
Posts: 10
Reputation: 220

Post » Fri Jun 09, 2017 10:48 am

1. Add a subevent event to the mouse click, add system compare 2 values, player.count > 0 (will not work as intended for actual multiplayer obviously)

2. Make the zombies solids and use the custom movement behavior with Push out solid

3. Use invisible spawning objects/sprite and spawn on those objects

4. You cant, I believe the max is 100kx100k atm (most likely more then enough) Or , you have to make an infinite scroller type of thing where layout stuff is generated around you as you "appear" to move closer to them
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Fri Jun 09, 2017 10:59 am

Alemismun wrote:- How do I stop the gun sounds when the player dies? When I click you can still hear the gun sound even tho the player got deleted...

There are many ways. A simple way would be a variable called death or someting like that. And the code would be:
On left button clicked and death is equal to 0 --> spawn bullet on layer 0 (and so on)
Zombie | on collsion with Player --> Player| destroy and set death to 1
System| On start of layout --> set death to 0
Alemismun wrote:- How do I make zombies not go trough each other? :mrgreen:

You can maybe make them solid. (Behavior. Dont know if that makes bugs. Try it. I dont have the time to test it. XD)

I would answer you last two questions too but i dont have the time. Sorry.
I hope i helped you
Cryttexx

Edit: i just saw somebody else answered already. :lol:
My Project at this time: robottory-2d-platformer-devlog_t190807



(Sorry for my english. I know it is not the best)
B
12
S
7
G
4
Posts: 102
Reputation: 3,046

Post » Fri Jun 09, 2017 11:04 am

lennaert wrote:1. Add a subevent event to the mouse click, add system compare 2 values, player.count > 0 (will not work as intended for actual multiplayer obviously)

2. Make the zombies solids and use the custom movement behavior with Push out solid

3. Use invisible spawning objects/sprite and spawn on those objects

4. You cant, I believe the max is 100kx100k atm (most likely more then enough) Or , you have to make an infinite scroller type of thing where layout stuff is generated around you as you "appear" to move closer to them

1. It worked well, thanks

2. Wait, how do I do that? I know how to make them solid, but how do I give them push behavior? Its not in the list :?

3. Then they will spawn on objects and if the player is unlucky enough to step on top of one of them it might cause errors

4. How do I make the layout generation thing?

Im sorry I am so bad at this :|
B
4
Posts: 10
Reputation: 220

Post » Fri Jun 09, 2017 11:05 am

Cryttexx wrote:
Alemismun wrote:- How do I stop the gun sounds when the player dies? When I click you can still hear the gun sound even tho the player got deleted...

There are many ways. A simple way would be a variable called death or someting like that. And the code would be:
On left button clicked and death is equal to 0 --> spawn bullet on layer 0 (and so on)
Zombie | on collsion with Player --> Player| destroy and set death to 1
System| On start of layout --> set death to 0
Alemismun wrote:- How do I make zombies not go trough each other? :mrgreen:

You can maybe make them solid. (Behavior. Dont know if that makes bugs. Try it. I dont have the time to test it. XD)

I would answer you last two questions too but i dont have the time. Sorry.
I hope i helped you
Cryttexx

Edit: i just saw somebody else answered already. :lol:


I tried making the zombies solid, the still go trough.
B
4
Posts: 10
Reputation: 220

Post » Fri Jun 09, 2017 11:21 am

Add the behaviour Custom movement to the zombies, and use the function action pushout solid when overlapping

You can also spawn zombies outside of the Viewport or at a certain distance from the player (player.X +1000 for example)

Automatically generating levels for infinite layout style can be found in the infinite runner example
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Fri Jun 09, 2017 12:01 pm

lennaert wrote:Add the behaviour Custom movement to the zombies, and use the function action pushout solid when overlapping

You can also spawn zombies outside of the Viewport or at a certain distance from the player (player.X +1000 for example)

Automatically generating levels for infinite layout style can be found in the infinite runner example

The zombie spawning outside of the player's viewpoint worked, thanks a lot!
Im still confused about the zombies, do I do it like this?
Image
And I can't get the push out solid action...
Image
B
4
Posts: 10
Reputation: 220

Post » Fri Jun 09, 2017 4:51 pm

Am at work arm so can't check for you.

There is also a plugin on the forum somewhere called "pushout solid" which makes the application a lot simpler.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Fri Jun 09, 2017 6:58 pm

lennaert wrote:Am at work arm so can't check for you.

There is also a plugin on the forum somewhere called "pushout solid" which makes the application a lot simpler.

Oh no problem, take your time :D !
I ended up working one out but...
It caused... problems...
Image lol
B
4
Posts: 10
Reputation: 220

Post » Sat Jun 10, 2017 7:27 am

Rex Pushout solid

Unziip and place the folder in construct2/exporters/html5/behaviors/

restart c2 and add the behavior to the zombies.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Next

Return to How do I....?

Who is online

Users browsing this forum: David181, Yahoo [Bot] and 14 guests