# Wintermute Engine Forum

## Game development => Help wanted and offered => Topic started by: uzumaki on March 14, 2013, 08:48:51 PM

Title: puzzle games like jigsaw or turning and cylindrical object to match sequence
Post by: uzumaki on March 14, 2013, 08:48:51 PM
hi guys,

i am a starter so i just needed a script for refference for mini puzzle games like turning a stone until it matches the symbol in it and then the door opens or something like and old little artifacts opens up after its been rotated properly to match the symbols ............help friends plz

::slug  ::wave
Title: Re: puzzle games like jigsaw or turning and cylindrical object to match sequence
Post by: eborr on March 15, 2013, 08:32:03 PM
Hi I don't have a specific script to point you at, but what I would suggest that you might do is to do a little research in how to write a puzzle game generically. The reason that I am saying that is that are different "scripts" for different kinds of games. For two dimensional puzzle games where you need to generate different tile sets each time,using WME you need to pull a bit of a stunt because WME only supports one - dimensional arrays.
Title: Re: puzzle games like jigsaw or turning and cylindrical object to match sequence
Post by: 2.0 on March 15, 2013, 10:35:49 PM
It's not any problem to create multi-dimensional array via single-dimension one.

Here is the example of two-dimensional array MxN.

Code: WME Script
1. var M = 100;
2. var N = 100;
3. var SomeArray = new Array (M);
4.
5. for (var i = 0; i<M; i=i+1)
6. {
7.   SomeArray[i] = new Array(N);
8. }

For working with this array can be used such functions:

Code: WME Script
1. function Set(var x, var y, var value)
2. {
3.   var a = SomeArray[x];
4.   a[y] = value;
5.   SomeArray[x] = a;
6. }
7.
8. function Get(var x, var y)
9. {
10.   var a = SomeArray[x];
11.   return a[y];
12. }

Hi I don't have a specific script to point you at, but what I would suggest that you might do is to do a little research in how to write a puzzle game generically. The reason that I am saying that is that are different "scripts" for different kinds of games. For two dimensional puzzle games where you need to generate different tile sets each time,using WME you need to pull a bit of a stunt because WME only supports one - dimensional arrays.
Title: Re: puzzle games like jigsaw or turning and cylindrical object to match sequence
Post by: uzumaki on March 19, 2013, 08:30:06 PM
thanks

ebor will check those in details

you rock  ::rock