Need help with a monopoly-style game

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello!

    I'm Lunar. I'm new to construct and I have no experience programming either . I'm working on a simple board game like monopoly. I've been doing a few tutorials but I couldn't find anything about board games.

    I just want to make the players (sprites) move through the grid boxes in the board.

    This is what I did:

    First I gave each player the private variable 'Vmoves'

    When the dice generate a random number between 1-6 'Vmoves' is set to that random number.

    I created a sprite called 'grid' 50x50 pixels, and then duplicated it to make the board.

    when player1: Value 'Vmoves' greater or equal than 1.

    >player1 angle equal to 0. ---->>player1 setX to player1X +50

    .................................... player1 setY to player1Y

    >player1 angle equal to 90 --->>player1 setX to player1X

    .................................... player1 setY to player1Y +50

    >player1 angle equal to 180 --->>player1 setX to player1X -50

    ..................................... player1 setY to player1Y

    >player1 angle equal to 270 --->>player1 setX to player1X

    ..................................... player1 setY to player1Y -50

    Also when player1 overlaps the sprite 'grid' --->>subtract 1 from player1 private variable 'Vmoves'

    And I repeated this for each player

    For changing the Angles: when player overlaps the 'Sprite Arrow' the player gets his angle set to match the 'Sprite Arrow'

    this way is a bit too long and I feel its not a good method.

    Is there a way to make the player move by my 'grid Sprite' boxes intead of using pixels ?

    I've been trying to make this work for a long time,

    I hope someone could help me, any tip will be really appreciated.

    Thank you!

  • hello lunar,

    have you taken a look at the 'grid movement' behavior? it might have what you need...

    http://sourceforge.net/apps/mediawiki/c ... d_Behavior

    welcome to construct...i'm learning as i go as well. the wiki has a lot of useful information.

    harrio...

  • Thanks harrio !

    I've just read that wiki page and I'm going to try with the 'grid movement 'behaviour. I'll post here my results

    Btw, are there any tutorials about the 'grid movement' behaviour?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Btw, are there any tutorials about the 'grid movement' behaviour?

    i don't know off the top of my head. i would check out the tutorials thread...

    http://www.scirra.com/forum/viewforum.php?f=8

    and/or do a search on grid movement threads in the forum. you might stumble across some good info.

    hope that helps...

    harrio...

  • Thanks again harrio !

    Actually, after playing a bit with the grid movement I just had an idea that solved all this!

    player1 angle equal to 0. ---->>player1 setX to player1X +grid.Width

    I feel embarrassed because now it seems so obvious

    I hope this will help someone too. Maybe later I'll post here the finished .cap when I discover how to attach a .cap

    Lunar

  • no problem, i've been helped here, so i'm more than glad to return the favor.

    for posting caps, i've noticed that it is the general practice of users here to post links from dropbox or sometimes even box.net. they are both free with more than enough free space. i use dropbox to post caps and html5 tests. it's pretty straightforward to setup. you should have no problems with it.

    keep constructing...

    harrio...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)