how do I move a number of steps after a dice roll

Get help using Construct 2

Post » Tue Jan 31, 2017 1:04 am

Hello Scirra forums.

I'm currently making my own game for the first time and I'm not very well-versed in construct 2 yet. I've figured out how to make a dice roll but I'm unsure of how to make it move a certain amount of steps. I need help in making so that when a dice is rolled the player can move any amount of up/down/left/right a number of times equal to the dice roll.

Thanks for the help. :)
B
2
Posts: 4
Reputation: 158

Post » Tue Jan 31, 2017 2:24 am

One possible general approach:

Create a variable - movesRemaining

Set movesRemaining to dice roll result

Upon moving, if movesRemaining is not 0, subtract 1 from movesRemaining
Mistakes were made.
B
53
S
27
G
114
Posts: 1,698
Reputation: 64,444

Post » Tue Jan 31, 2017 8:36 pm

Are there move restrictions (obstacles.. etc) in play ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Feb 01, 2017 5:24 am

@oosyrag: okay thx for the help, I'll try it out.
@99instances2Go: rather than obstacle that stop the players from moving ahead there might be mini games triggered upon landing on certain tiles.
B
2
Posts: 4
Reputation: 158

Post » Wed Feb 01, 2017 8:42 am

It is a different approach, but cant approach without info. It is an illusion to expect general solutions.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Feb 01, 2017 3:39 pm

B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Thu Feb 02, 2017 6:45 pm

@korbaach: Thx for the help!! It's very close to what I'm looking for except that I hope the player is able to choose the direction it is moving in, in case of a cross road. Anyways, I've tried re-creating your example from scratch and so far managed to work except for the fact that it wouldn't turn at the corners. I've double check the event sheet of mine and your sample and it looks the same. Is there something I should double check in the event sheet to ensure that it turns in the corners??

(edit: sry, its okay. I've found my problem. Thx for the help!!)
B
2
Posts: 4
Reputation: 158

Post » Fri Feb 03, 2017 8:49 am

try this one:

chooseBoardMove.capx


Image
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Sat Feb 04, 2017 5:52 pm

@korbaach: That's exactly what I'm looking for! Thx so much for your help!!
B
2
Posts: 4
Reputation: 158


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests