Minesweeper experiment

Get help using Construct 2

Post » Sat Oct 29, 2011 4:41 pm

On a lark I started a Minesweeper clone today as my first attempt at using arrays for something, and have got the very basic stuff working pretty well, but there are a couple of things I'd be grateful for some assistance with.

Here is the capx, and game

1. I would like to be able to sweep away adjoining cells once an empty cell is clicked. I attempted this with a pretty hacky solution involving spitting out invisible "sweeper" sprites that would overlap other cells to instigate a sort of chain reaction... and this seems to work at first, but then it slows down to a crawl and then the browser locks up.

I would have tried to test for things overlapping at certain offsets, but this doesn't seem to be implemented in C2 yet. Am I stuck until this is updated, or is there another way?

2. I've been a little inconsistent with how I am detecting things such as whether there is a bomb under a particular cell, or on an adjoining cell, or if that cell has been clicked... so during my experimentation I created a whole lot of instance variables that are probably redundant. I'd be interested to hear if there are more efficient ways of doing this as well.

I would prefer to be able to do everything from within the context of the array if possible, rather than relying on the sprites, but I'm not familiar with what you can and can't do with an array yet.

3. Any other comments or suggestions on the way I've gone about this whole thing would also be appreciated. I still haven't even thought about implementing things like marker flags, a timer, scoring system or even detecting once you've completed the level... baby steps I guess.
Posts: 102
Reputation: 6,483

Return to How do I....?

Who is online

Users browsing this forum: ADONAYHVH, flemmig, Heeroyuy, johnsmith, nav and 16 guests