# [BEHAVIOR] Isometric

### » Wed Nov 18, 2015 9:06 pm

Seems to be a general problem with destroying objects with this behavior. Not sure when I'll have time to really break it down and see what design flaw I used.
B
97
S
36
G
131
Posts: 5,514
Reputation: 83,466

### » Wed Nov 18, 2015 9:27 pm

Not sure when I'll have time to really break it down and see what design flaw I used.

B
26
S
3
G
1
Posts: 480
Reputation: 2,290

### » Wed Mar 23, 2016 5:42 pm

Hello R0J0 hound.
First I would like to greatly thank you for your contribution.
I'm using it for a personal project, but I'm having trouble creating a Click&Point moving from your pathfind example

I believe if I can convert the current coordinate of my mouse in isometric position to the original position 2D I would succeed in moving the player to mouse target, but i don't know how to convert

There is the possibility of including a callback function in your plugin to return a 2D position starting from an isometric position?
Or is it possible to explain to me how I can proceed to achieve this result

thanks (^.~) sorry my bad english!
B
6
S
1
Posts: 2
Reputation: 354

### » Wed Mar 23, 2016 6:11 pm

@neoneper
The plugin has expressions for isometric to layout position, but I guess it would be good to have conversions going the other way. For now here's the equations to do it:

For a layout position x,y, you can find the isometric position ix, iy with this:

ix = 0.5*x+y+iz-400
iy = -0.5*x+y+iz-80

You need to specify an isometric z: iz
B
97
S
36
G
131
Posts: 5,514
Reputation: 83,466

### » Wed Mar 23, 2016 7:16 pm

Sorry for my ignorance, but I'm not succeeding!
I tried with his equations but no success!
I also tried this second way, but still without success!
Look
B
6
S
1
Posts: 2
Reputation: 354

### » Fri Mar 25, 2016 2:53 am

@neoneper
I guess I don't understand what you're going for exactly.
In that example there are two layers. One is a top view, and the other takes the top view positions and treats them as isometric positions.

What I gathered from your question you wanted to be able to click on the isometric view and have that position converted to the map view. I that's the case then the equations I gave should do it.

On mouse click
--- player find path to 0.5*mouse.x+Mouse.y-400, -0.5*mouse.x+Mouse.y-80
B
97
S
36
G
131
Posts: 5,514
Reputation: 83,466

### » Thu Apr 21, 2016 7:03 pm

Very Very Good Behavior thanks a lot ! i have not tried to use it yet but it's opening big "perpectives" to makes some games !
I really hope C3 will have a simple system to make some isometric view games !
B
3
Posts: 1
Reputation: 177

### » Wed Apr 27, 2016 11:00 am

@R0J0hound

Firstly, this is the best custom Behaviour I have seen on Construct2. I see so many possibilities now. Honestly if you had made this a paid plugin I would be the first one to buy it

I was working on your Pathfind CAPx, again marvelous idea! I just have one issue. WIil try to explain with an example, I am using your pathfind CAPX, I created 2D grid starting from the top left corner on the "PathFind" layer. I want my Isometric map to be fix in middle of the screen so I disabled the "Scroll to Player" action.

When I run the project, the Isometric view starts somewhere at the middle bottom of the layout. Is there a way I can make the isometric view centered to the layout? I have set parallax to 0,0 for both layouts.
Any help would be really appreciated!!

Attaching screenshot for ur reference
Create your own Isometric Runner Game using C2:

Check out my game "Last of the Survivors":
Play Store
App Store
B
62
S
14
G
2
Posts: 431
Reputation: 5,612

### » Wed Apr 27, 2016 5:56 pm

@SamRock
0,0 on the map goes to 320,240 in the iso view. Do you either have to move the map or change the scroll position to a better center location.
B
97
S
36
G
131
Posts: 5,514
Reputation: 83,466

### » Thu Apr 28, 2016 12:54 pm

R0J0hound wrote:@SamRock
0,0 on the map goes to 320,240 in the iso view. Do you either have to move the map or change the scroll position to a better center location.

I used your second suggestion. Scrolled to Center of the isoview and increase size of my Layout! Thanks for the help.

Have another question now, since I moved the scroll to center isoView within the layout. How do I translate mouse within isoView to the map grid?

Secondly, not necessarily related to your Behaviour. But I noticed that the pathfind doesnt seem to work on narrow 32px grids. For example in my image above, when I place the "player" in the middle section, it is not able to find a path out. Do you have any suggestion?

Lastly, thanks for your help. You have no idea how much smile you brought to me. If this work, I will have ur name all over the credit screen
Create your own Isometric Runner Game using C2:

Check out my game "Last of the Survivors":
Play Store
App Store
B
62
S
14
G
2
Posts: 431
Reputation: 5,612

PreviousNext

### Who is online

Users browsing this forum: No registered users and 0 guests