Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: puzzle games like jigsaw or turning and cylindrical object to match sequence  (Read 4909 times)

0 Members and 1 Guest are viewing this topic.

uzumaki

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 8
    • View Profile

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
Logged

eborr

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 196
    • View Profile

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.
Logged

2.0

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 217
    • View Profile

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.
« Last Edit: March 15, 2013, 10:41:18 PM by 2.0 »
Logged

uzumaki

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 8
    • View Profile

thanks

 ebor will check those in details

                          you rock  ::rock
Logged
 

Page created in 0.046 seconds with 21 queries.