Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411472 Posts in 69369 Topics- by 58423 Members - Latest Member: antkind

April 23, 2024, 11:56:38 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Clickteam How to make Sokoban?
Pages: [1]
Print
Author Topic: Clickteam How to make Sokoban?  (Read 1429 times)
cherryblossom
Level 0
**


View Profile
« on: November 19, 2017, 02:58:01 AM »

I'm my clients care worker. She has been using the free version of Clickteam for making games. Are there anyone else here who uses it? She once found this tutorial when she tried to find ideas for games what she could make with Clickteam:



That tutorial is not about Clickteam, but she later noticed that someone else had made a similar game with Clickteam, Sokoban. My client tried the functions in her own file but it didn't work at all. She knows that she needs isometric movement with it. She once downloaded this example file from somewhere about that movement type: "player grid movment examples.mfa". My client also figured out how to push the boxes. This is what she has so far:




My client found one way to get an object to stop when it collides with something: in this almightyzentaco's tutorial he's using custom movement:




He had also added functions that gets the active to stop when it collides with an obstacle. My clients has tried it in her file:


It works with the red block but not with the pushable blocks:


First the pushable block goes on top of the obstacle and then it jumps in front of the red block. Those functions didn't also solve the issue where the pushable objects gets on top of each other:


The movable boxes are duplicates. She did try spread value in between the boxes. Could anyone help my client?
Logged
BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #1 on: November 20, 2017, 10:19:52 AM »

I haven't used click team products in a long time. But I'll try to anwser.

Anyway, about your problem. At the moment you are moving the pink block, then telling any blue blocks to get out of the way after the pink block rams into them. But you haven't told the game that you cannot push a blue block if there is something on the other side.

I think what you want to do is add extra conditions to 2-5. E.g for moving left, in addition to the current conditions,you want to check that
1) it is not the case that there is a red block to the left; and
2) it is not the case that (there is a blue block to the left and any other block to the left of that one)

Condition 1 will stop you walking into red blocks.
Condition 2 will stop you pushing blue blocks when there is something behind them.

Does Fusion allow you to write conditions like that? I don't know. You'll have to try it out.

It may necessary to create "probe objects". These are invisible objects that have a rule like "Always: Set x position of probe_left_1 to be player x position - 32; Set y positon of probe_left_1 to be player y position". Then you can check what is one space left of the player by checking collisions with that probe object. You'll need 8 probe objects to check condition 2 for all directions.

Hope that helps!


Logged
cherryblossom
Level 0
**


View Profile
« Reply #2 on: November 23, 2017, 03:30:10 AM »

I haven't used click team products in a long time. But I'll try to anwser.

Anyway, about your problem. At the moment you are moving the pink block, then telling any blue blocks to get out of the way after the pink block rams into them. But you haven't told the game that you cannot push a blue block if there is something on the other side.

I think what you want to do is add extra conditions to 2-5. E.g for moving left, in addition to the current conditions,you want to check that
1) it is not the case that there is a red block to the left; and
2) it is not the case that (there is a blue block to the left and any other block to the left of that one)

Condition 1 will stop you walking into red blocks.
Condition 2 will stop you pushing blue blocks when there is something behind them.

You may have misunderstood something. The red box is the player object. There is only one of them because that game is for one player. The light blue boxes are duplicates and they only move when they are pushed.
 
It may necessary to create "probe objects". These are invisible objects that have a rule like "Always: Set x position of probe_left_1 to be player x position - 32; Set y positon of probe_left_1 to be player y position". Then you can check what is one space left of the player by checking collisions with that probe object. You'll need 8 probe objects to check condition 2 for all directions.

Hope that helps!

My client had found Sokoban example file here: http://www.andersriggelsen.dk/mmf2_examples.php

Here is a picture of it:


In that file the object is moved with detectors. Here is some of the events:


When my client tried it herself, it didn't work at all. Because of that she's been trying to find other ways to do it.

In case that someone doesn't know, this is about what's the difference between eight directions movement and custom movement:




She knows that in some things the custom movement is better, but it may be difficult to add collision to it. That is one issue with the light blue boxes. The other issue is that they are duplicates. Here is some information about it: http://www.create-games.com/article.asp?id=1975

We told in the first message what she has already tried. It works with the red box but it doesn't work with the light blue ones. Does anyone know what she could try next?
Logged
BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #3 on: November 23, 2017, 04:51:41 AM »

Evidentally we have some color perception differences. Try replacing "red" with "brown" (i.e. the wall objects) and re-reading my post.

Note the detectors from your 2nd example work the way I was proposing "probes" would work in my post.
Logged
cherryblossom
Level 0
**


View Profile
« Reply #4 on: December 03, 2017, 01:50:30 AM »

Evidentally we have some color perception differences. Try replacing "red" with "brown" (i.e. the wall objects) and re-reading my post.

Note the detectors from your 2nd example work the way I was proposing "probes" would work in my post.

My client didn't know that you meant the obstacle. She has already tried it with detectors. The pictures were taken from an example file someone else had made. My client looked at one of her old files and she found one mistake there. When she fixed it she got the player object to move but she noticed that there is still something wrong with it. The player object goes under the pushable box although it should push it:



She still thinks that it works better in her newer file:





The issue is that my client still doesn't know how to get the pushable boxes to stop when they hit something.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic