How do I use random spawning

Just started using Construct 2? Post your questions here

Post » Mon Apr 13, 2015 5:18 pm

Hi, everybody

I've been looking for a way to do a randomized spawning at the top of the layout, just outside the frame. Untill now I've found plenty of different tutorials and tips on how to do it, but I'm really not sure how to convert their example into my own situation as I'm noob at this.

What i would like to happen is, the red sprite in the bottom of the layout should spawn randomly along the marked area above the layout, and go down onto the layout.

So far the events I've got on the picture are what I would think worked but clearly it didn't.
Also here is a link for the pictures and capx:https://www.dropbox.com/sh/ew81qh5o8au9esu/AADZxu6JmdC6CtwFtEefda0fa?dl=0
B
3
Posts: 5
Reputation: 185

Post » Mon Apr 13, 2015 5:52 pm

First step... :D
Image
and
Image
Image
B
62
S
23
G
7
Posts: 1,470
Reputation: 10,731

Post » Mon Apr 13, 2015 6:02 pm

Hi

I have made a few changes to your project
1. I recommend you to have an event sheet for every layout, except if you have an event sheet for global functions
2. Be carefull with the existing objects in your layout (for example, you already have a red bullet on the screen, so that bullet will travel forever)
3. Take a look about the https://www.scirra.com/tutorials/73/sup ... reen-sizes for more information about the ViewPort

Feel free to ask me anything :)

https://www.dropbox.com/s/z8xrnba0ovn4c5h/Smudgedy%20v2.capx?dl=0
B
81
S
23
G
10
Posts: 647
Reputation: 10,210

Post » Mon Apr 13, 2015 6:14 pm

Thanks a lot I'll take a look and see if it works :D
B
3
Posts: 5
Reputation: 185

Post » Tue Apr 14, 2015 7:39 pm

Hi once again :)

Thanks a lot for the last help I used it and it seemed to work just fine.

But now I have another problem. I would like the player to be able to choose between WASD and the arrow keys. Though it would seem that I can't get my initial idea to work as the simulate controle doesn't seem to work inside a group.

Either that or I've fucked it somewhere else :)
Hope you can help here's my dropbox link with the updated capx:https://www.dropbox.com/sh/h397cafmta5jdw3/AADEgoIbCh3pc65q-9KgcNXSa?dl=0
B
3
Posts: 5
Reputation: 185

Post » Tue Apr 14, 2015 7:59 pm

Hi,

On "main menu" eventsheet:

on check2 opacity = 100 --> set "greenthing" variable WASD to 100 instead of 1

Works better
Image Image
B
19
S
10
G
125
Posts: 867
Reputation: 64,937

Post » Sat Apr 18, 2015 2:24 am

Did you figure it out?
B
81
S
23
G
10
Posts: 647
Reputation: 10,210


Return to Beginner's Questions

Who is online

Users browsing this forum: Raynethemagi and 1 guest