frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

How Do I Make Random Blocks Fall From the sky in random places/times?

I am making a school project and I wanted to make a game that has blocks fall from the sky at random times and in random places. I was not sure if this was even possible or not but I just wanted to see if anybody else has ever done anything like this before.

Comments

  • edited January 6
    I think this is what you mean, right?

    Create a new object, this object will spawn new objects that fall down from the sky.

    You can use the random behavior to get a random number between a minimum and maximum value.

    First you want that the object spawns objects between different delays. And you want the minimum 1 second and the maximum 5 seconds (example). So the minimum of the random behavior is 10 (because 10 = 1 second in a timer) and the maximum is 50.

    So in the object you have something like this:
    [once] --> [random (min: 10) (max: 50)] --> [(start and delay) timer]
    Start starts the timer.
    Delay changes the delay of the timer (you got the value from the random behavior)

    And now you have an apple and a banana object (example). And you want both of them fall from the sky in random places. The minimum of the random behavior is 1, and the maximum is 2. Because you have 2 objects.

    Then you have 2 filters. The first filter is "equal to 1"and the second one is "equal to 2". When it's 1, emit an apple. When it's 2, emit a banana.

    Behaviors AFTER the timer:
    [random (min: 1) (max: 2)]
    Two lines to two filters:
    --> [filter (equal to 1)] --> [emit (apple)]
    --> [filter (equal to 2)] --> [emit (banana)]

    So the output of the random behavior has to lines to two filters.

    When you emit the apple/banana. You want it to spawn in a random place. So I think you want the top of your game. The Y axis is 0. The X axis has to be random. And the maximum of the random behavior is the lenght of your game.

    For the X axis: (random)
    [once] --> [random (min: 0) (max: lenght of your game)] --> [(x) position (use grid)

    For the Y axis: (very simple because it's 0)
    [once] --> [number (0)] --> [(y) position (use grid)]


    Don't forget to check USE GRID in the position behaviors!

    I hope this helped. If you have any problems or really didn't understand what I said. Please do not hesitate to reply! We really want to help you ;)
  • http://flowlab.io/game/play/571270 here is the game that is for my project. I am having a few problems with it. I tried to copy it off of the monkey game but it won't work. The blocks do not fall. Do you know how to fix this and do you know how to make the player die when it falls on top of him?
    Thanks for the help
    -Cole
  • Are the objects movable?
  • It looks like the "affected by gravity" gravity checkbox for the "smoke" object is not selected, so gravity doesn't affect it, and it doesn't fall. Just enabling this setting should fix the issue, I think.
  • This is not the problem, I have checked the movable and gravity boxes but they still do not fall. :(
  • I just opened up the game and looked at the "Smoke" objects - the "affected by gravity" check box is not selected, so these will definitely not fall.
  • Haha :D you already said that Grazer.
Sign In or Register to comment.

flowlab.io

| Create your own Web, iOS and Android games.
@ 2016 Flowlab.io, All rights reserved.
Powered by VanillaForums, Designed by ThemeSteam

Contact us

[email protected]

Get In Touch