Author Topic: Coding Help  (Read 14128 times)

0 Members and 1 Guest are viewing this topic.

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 23
  • Posts: 930
  • Eufloria: Yes
Re: Coding Help
« Reply #15 on: December 06, 2011, 03:24:39 AM »
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: 5
  • -Receive: 27
  • Posts: 1,524
  • They'll eat you next!
  • Eufloria: Yes
Re: Coding Help
« Reply #16 on: December 06, 2011, 03:40:32 AM »
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! :D):

Code: [Select]
for range = 0.2,1.6 do

tile =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()) then

return tile;

end

end

return nil;

It's a little different in java, almost left some pieces of java code there. I'm too used to it :P

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

Darkzlime

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

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 23
  • Posts: 930
  • Eufloria: Yes
Re: Coding Help
« Reply #18 on: December 15, 2011, 03:17:00 AM »
Not really wanting help, more trumpet-blowing.

I just got a multithreaded VB.Net program running.

kmercy

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

I just got a multithreaded VB.Net program running.

Not much a a challenge really loads of tuts about that ;)

Aino

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

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 4
  • -Receive: 23
  • Posts: 930
  • Eufloria: Yes
Re: Coding Help
« Reply #21 on: December 16, 2011, 01:07:44 AM »
I know, but it's made my bruteforcing sooo much easier. In the region of 2min to ~ 1second.

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 5
  • -Receive: 27
  • Posts: 1,524
  • They'll eat you next!
  • Eufloria: Yes
Re: Coding Help
« Reply #22 on: January 06, 2012, 03:32:39 AM »
I'm making a game like Eufloria, and the bases and the "seedlings" have their own movement. This is all fine until I update the "seedlings" which includes render, update movement(add movement to position) and the classes separate update(this is so that any specific action done by the different stuff can be done).

What happens when I update is that the bases, which has an ArrayList for all the units begins to move too, even though it doesn't have any motion. So here's the question: Does lists inside of an object cause it to happen to the list carrier too? (this is java too, just so you know :))