Game Maker Studio: How to Create Random Objects.
Visit my anime and game site: http://mcanime1.wixsite.com/mcanime
GMX file: https://goo.gl/TM7Pmo
You click on Question Mark
Box:
Events:
Left Pressed
Actions:
{
r = irandom_range(1,4)
if r=1
makethis=cherry
else if r=2
makethis=orange
else if r=3
makethis=grape
else if r=4
makethis=banana
adc=instance_create(x,y, makethis)
}
or
Let computer create the random objects
Box:
Events:
Create
Actions
Move direction, make it 3 or less
Events:
Step
Actions:
Let computer create the random objects
num=irandom_range(1,150)
if num 5 (had to take out the angle bracket, due to Youtube, please use a right pac man sign between num and 5)
{
r = irandom_range(1,4)
if r=1
makethis=cherry
else if r=2
makethis=orange
else if r=3
makethis=grape
else if r=4
makethis=banana
adc=instance_create(x,y, makethis)
}
Events:
Collision with blocker
Actions:
Reverse horizonal direction