Dice and other bizarre questions

Get help using Construct 2

Post » Sun Mar 04, 2012 12:05 am

Hello,

I'm kind of new to programming, despite learning it for almost my whole life. I know a lot of concepts, but when it comes to putting them together, they all fall apart.

I'm trying to make a game involving dice. The idea is that you roll the dice, and then are able to trade your dice roll for money, or save your roll and get an extra die for your next turn. That's the whole game.

But - I'm having trouble programming it. I have a "start game button", a "news ticker" of sorts, all that. But I don't know how to make it so that the game starts after the button is pressed.

After that, I need to program in the dice behavior. How do I make the dice be randomized?

I don't like to take advice from others, it feels like stealing... But I'm so stuck I don't know what else to do.

Thank you, if you do end up helping me,
KatamariManatee
B
2
Posts: 1
Reputation: 252

Post » Sun Mar 04, 2012 12:46 am

Ok start game button, add the mouse object, then add the event:

Mouse.OnObjectClicked(YourButton)
     -> System.GoToLayout{YourLayout

Then for the dice, to get a random number between 1 and six use rnadom()

like this:

Global var die_value
Mouse.OnObjectClicked(Dice)
     -> System.setValue(Die{int(random(1, 6))})
     ->
B
29
S
12
G
7
Posts: 740
Reputation: 7,839


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, Braus, Kagubro, Mirlas, zeneizel and 20 guests