### Author Topic: Coding Help  (Read 2130 times)

0 Members and 1 Guest are viewing this topic.

#### Pilchard123

• Tester
• Old Oak
• Thank You
• -Given: 0
• Posts: 899
• Eufloria: Yes
##### Re: Coding Help
« Reply #15 on: December 05, 2011, 07:24:39 PM »
If moving your mouse moves the camera like in Minecraft, that's easy enough to do.

If your mouse is over it, you are looking at it.

#### Aino

• Ent
• Thank You
• -Given: 1
• Posts: 1,483
• They'll eat you next!
• Eufloria: Yes
##### Re: Coding Help
« Reply #16 on: December 05, 2011, 07:40:32 PM »
But, it's more complicated than that, in LWJGL(I'm not making my own 3D engine ever!) I don't think it tells where the block is placed on the screen...

But I have two variables, Yaw and Pitch, maybe it works?

I could do it this way(lua style! ):

Code: [Select]
`for range = 0.2,1.6 dotile =getTile(math.floor(X+math.cos(Yaw)*range),math.floor(Y+math.sin(Yaw)*range);if (tile ~= nil and tile.getX() ~= math.floor(player.getX()) and tile.getY() ~= math.floor(player.getY()) and tile.getSolid()) thenreturn tile;endendreturn nil;`
It's a little different in java, almost left some pieces of java code there. I'm too used to it

X = player pos X(float)
Y = player pos Y(float)
Yaw = yaw rotation
Tile = a block
« Last Edit: December 05, 2011, 07:45:17 PM by Aino »

#### Darkzlime

• Seed
• Thank You
• -Given: 0
• Posts: 2
##### Re: Coding Help
« Reply #17 on: December 06, 2011, 09:48:25 PM »
make a boolean that gets the dimensions of the box and checks if its true

#### Pilchard123

• Tester
• Old Oak
• Thank You
• -Given: 0
• Posts: 899
• Eufloria: Yes
##### Re: Coding Help
« Reply #18 on: December 14, 2011, 07:17:00 PM »
Not really wanting help, more trumpet-blowing.

I just got a multithreaded VB.Net program running.

#### kmercy

• Seedling
• Thank You
• -Given: 0
• Posts: 34
##### Re: Coding Help
« Reply #19 on: December 14, 2011, 11:45:39 PM »
Not really wanting help, more trumpet-blowing.

I just got a multithreaded VB.Net program running.

#### Aino

• Ent
• Thank You
• -Given: 1
• Posts: 1,483
• They'll eat you next!
• Eufloria: Yes
##### Re: Coding Help
« Reply #20 on: December 15, 2011, 09:47:48 AM »
Kmercy, don't look down, look up.

#### Pilchard123

• Tester
• Old Oak
• Thank You
• -Given: 0
• Posts: 899
• Eufloria: Yes
##### Re: Coding Help
« Reply #21 on: December 15, 2011, 05:07:44 PM »
I know, but it's made my bruteforcing sooo much easier. In the region of 2min to ~ 1second.

• Ent
• Thank You
• -Given: 1