A basic Puzzle example (Now it even swaps back!)

Post your own tutorials, guides and demos.

Post » Thu Jul 07, 2011 12:10 pm

When i run tutorial(3) in debug mode, the following occurs:



The number above the red arrow is constantly increasing.

Any way to stop this ?chrisbrobs2011-07-07 12:10:28
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Thu Jul 07, 2011 1:15 pm

[QUOTE=chrisbrobs] When i run tutorial(3) in debug mode, the following occurs:



The number above the red arrow is constantly increasing.

Any way to stop this ?[/QUOTE]

The debugger recognizes the count expression, if there isn't any instance of that object. This isn't a bug, but a quirk of the debugger and shouldn't affect performance.


[QUOTE=TheX]Hi!!!

AweSome tutorial!!!
but...ofcourse...few questions)))

In Your method can't make blocks with animations?
and one more important: If block don't math than they should swapped back.

I try to make it for 2 days and... don't know what to do)

Please help!!!

Thanks alot for tutorial!)
[/QUOTE]

Of course animations are very possible with this method. Why would you think otherwise? What problem do you face trying to animate the blocks?

Also I mentioned earlier in this thread that I considered adding unmatched blocks being swapped back. I have a cap with that functionality floating around my hdd, I just need to dig it up. Can't tell about the needed events on top of my head, as I haven't looked into this example for quite a while. Just give me a little time.

Thanks for your interest in this tutorial!
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Wed Jul 13, 2011 2:03 am

Hi PixelRebirth.

Fantastic tutorial.

But as many other say, i would love to see the function, where they dont match, and that they will be swapped back.

Really hope you can come up with something.
Because i cant really think of a way to do it.

Great work!
B
34
S
8
G
7
Posts: 498
Reputation: 7,753

Post » Wed Jul 13, 2011 3:48 pm

[QUOTE=xanxion]But as many other say, i would love to see the function, where they dont match, and that they will be swapped back.[/QUOTE]

I had this functionality for a while in an unfinished match-3 game of mine, which uses a slightly modified version of the engine of this tutorial. Didn't bother to add it here so far, as there didn't seem to be a demand.

But I here you guys and I just added it in, you can download the updated part 3.1 from the first post and enjoy swapping back.

It's a bit of a hack job, but I'm fairly sure it works correctly. If not feel free to reply with any issues you might run into.

[QUOTE=TheX]
In Your method can't make blocks with animations?[/QUOTE]

Let me just quickly come back to that: I think I just realized what the problem was. Of course you can't use frames only for the different blocks like in this example if you want to animate them. You have to use animations instead. To randomize the blocks in a similar fashion you have to use naming conventions for your animations (1_moveright, 3_moveup,...) and a PV to keep track of the actual type (color) of your block. Hope that helps.



B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Wed Jul 13, 2011 5:05 pm

Just added it my cap...and for some reason it worked first time

Thanks PixelRebirth.
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Thu Jul 14, 2011 12:40 pm

Glad to see that it works out well for you chris!

Just a little heads up though: there has still been a little bug in the engine, which allowed the player to click a block while there were still operations pending, if he happened to click at the right tick.

Most of the time this shouldn't have occured, since you basically only realize it if you're going about rapidly clicking blocks while others are moving. Even then it's not that easy to spot.

Anyway, this is fixed now. The engine should be rock solid.

So please redownload Part 3.1 if you downloaded before this post was made. Thanks and sorry for the inconvenience.PixelRebirth2011-07-14 12:44:13
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Thu Jul 14, 2011 1:49 pm

Just added it to my build and it runs ok, thanks for that.

-> System: Set global variable 'Moving' to 1

I downloaded your tutorial 'lifebar.cap', gonna see if i can use that instead of the progress bar object.

Will post details when i get it sorted.

The only thing missing now is an 'hint' button.

One question i wanted to ask...can you use more than '4 frames' with the engine ?
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Thu Jul 14, 2011 2:08 pm

[QUOTE=chrisbrobs]
One question i wanted to ask...can you use more than '4 frames' with the engine ?[/QUOTE]

Yes, you can. Are you getting at using more than 4 different types of blocks or do you mean animating them? Both is possible.

In a previous reply (see above) I elaborated a bit about using animations instead of simply frames.

If I'm misunderstanding your problem or you do need additional help feel free to drop me a PM.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Thu Jul 14, 2011 2:50 pm

[QUOTE=PixelRebirth] [QUOTE=chrisbrobs]
One question i wanted to ask...can you use more than '4 frames' with the engine ?[/QUOTE]

Yes, you can. Are you getting at using more than 4 different types of blocks or do you mean animating them? Both is possible.

In a previous reply (see above) I elaborated a bit about using animations instead of simply frames.

If I'm misunderstanding your problem or you do need additional help feel free to drop me a PM.[/QUOTE]
-----------------------------------------------------

I meant having a block with more than 4 images, like bejeweled has.

If it involves rewriting eveverything, i will stick at four.(I don't think my brain would be able to cope)

B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Fri Jul 15, 2011 1:26 am

[QUOTE=chrisbrobs]I meant having a block with more than 4 images, like bejeweled has.

If it involves rewriting eveverything, i will stick at four.(I don't think my brain would be able to cope)[/quote]

You can add more frames than just 4 of course for different blocks. All you need to change is the random generation, which foolishly looks like the following

Random(4)+1

this can be found once in the 'Startup' event sheet and also in the 'Spawning' event sheet.

Change it to

Random(Block.GetAnimationFrameCount)+1

and it'll work with any amount of different blocks (frames). The rest of the engine logic will still work perfectly.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

PreviousNext

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 2 guests