MAKING A PUZZEL

Started by j-Hed, Tue 18/11/2003 12:22:49

Previous topic - Next topic

j-Hed

Hi!

I have a room with a table as a background image and on it there are pieces of a puzzel. I want be able to move them around until every piece is at the right spot. I was thinking about having a hotspot for every position where the pieces SHOULD be. When all  the pieces are put over the right hotspot the player character will tell it's solved or something.
I don't know if this is a good/working way of doing it but please let me know if you have any suggestions.

Thanks!

Jongetje

Hi j-Hed,

I've got a similar idea for a puzzle in my game. I want to make a rush hour type puzzle, which is also about moving objects in the right place. Because in my puzzle it is important that different objects block each other, I thought the easiest way to do it is by using variables for the x and y position on the table. I devided my table in columbs (A-E) and rows (1-5). Then I made 25 variables. (A1, A2, ..., E5). I made a variable "0" if there was no object on it and I made a variable x if object x is on it (for example, if object 3 is in the 3rd columb (C) and the 2nd row (2), the variable C2 is made "3". If you move an object you also change the variables. With the variables you can check if an object can move if you ask it to or if it is blocked (for example, if you want to move object 3 from C2 to C3 and C3 is not "0" then it won't move).

I'm sorry for the chaotic explanation. I'm not at home right now so I don't have my game with me.

Good luck,
Jongetje

Ishmael

I'd do a closeup of the table, with the pieces on it as objects, and coding so they can be picked up and they'd follow the mouse cursor, and could be droped on a free space. Like, the script would check if there's a piece in the position you're trying to put it, it'll make a sound or blink a red square or something, and to check if the puzzle is solved correctly, just use a series of GetObjectAt()s to check if all pieces are where they should. Though this could only be used for smaller puzzles, as there's an objects per room limit... But a workaround is using characters, or raw drawing and a load of variables to set&check where are the pieces.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk