Author Topic: Loop and random number commands  (Read 1392 times)

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Loop and random number commands
« on: December 31, 2018, 06:05:15 PM »
Hello, I'm Antikore. These are new suggestions for PB

Loop command · Loop value · Random number placeholder/expression

Loop command
This command will loop a bunch of commands fast. This maybe can be done with timelines but timelines are limited in speed. The loop command is fast as command execution
Code: [Select]
loop 5 times
[
<player 1>[loop value]
if health < 1
{
break loop
}
]
Break loop will finish the loop even if there is more to repeat.
Loop value is the number of the time it repeated. For example, at the 2nd repeating of a loop 5 times. The loop value is 2

Random number placeholer/expression
This will generate a random value between two pre-selected ones.
Example:
Code: [Select]
#Roll the dice
game var dice_value = [random number between 1 and 6]
<player 1>[game var dice_value]
This will set the variable dice_value to a random number between 1 and 6. That means this can be randomly 1 5 2 etc. You can set between which values to select.
Example:
Code: [Select]
#Casino Machine
game var casino_numbers = [random number between 100 and 999]
if game var casino_numbers = 777
{
#You win code!
}

Thank you for reading :D
Sorry because my English is not very good because I'm Spanish ;) :P

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Loop and random number commands
« Reply #1 on: December 31, 2018, 09:55:55 PM »
If this is taken, I can create special places with random items in boxes and such! I also had an idea to re-create board games with PB. This would be AWESOME!

Antikore

  • Developing Mortal Theater at day, developing depression at night.
  • Level 22: Trex
  • *
  • Posts: 2020
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Loop and random number commands
« Reply #2 on: January 01, 2019, 10:20:17 AM »
I thought with random numbers and loops something epic an awesome!
Randomly selected rooms creating a dungeon, but I will not spoil future ideas :D
Sorry because my English is not very good because I'm Spanish ;) :P

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Loop and random number commands
« Reply #3 on: January 01, 2019, 11:58:42 PM »
Okay. Well, I think this would be helpful in my theory for making 2D top-down board games with PB. Something like Candy Land, or Sorry, or something like that. It would take lots of work though!