Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (555)
Games in Android Showcase (148)
games submitted by our members
Games in WIP (601)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 ... 5
1  Discussions / General Discussions / Re: Does Java have 'pointers on: 2015-02-20 22:08:19
Shi have it but they hidden in JVM.

if you need something similar like pointers you can use (without harass with JVM and unsafe)

Object that hold variable object - i use it like pointer for primitive types

Yes its some crap code but technical its pointers)

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
public class Byte_Obj{
   public byte b;
   public Byte_Obj(){}
   public Byte_Obj(byte b){this.b = b;}
   public byte get(){return b;}
   public void set(byte b){this.b = b;}
   public void inc(){b++;}
   public void dec(){b--;}
   public String toString(){
      return new String ("" + b);
   }
}


for obj i use

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
public class Obj_Obj <E>{
   public E Obj;
   public Obj_Obj(){}
   public Obj_Obj(E obj){set(obj);}
   public E get(){return Obj;}
   public void set(E obj){Obj = obj;}
   public String toString(){
      return new String("" + Obj);
   }
}


Up:
Pointer must be able to carry out arithmetic operations and read DIRECTLY from the computer memory and not from JVM memory

You can change memory that use Java and all that fluffy things with pointer memory Wink
its called Direct buffers

http://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer.html
allocate mem and then play with unsafe, - get mem address place allocated, and change values there)
but dont try move ther JAVA objects - i try its funny but crapy

Objects become out of mem space GC JVM and when GC called JVM try delete them
or relocate them when mem usage grows
so data stay same but objects marks as deleted
and when you try use them JVM crashes =)

it have some tricks for using obj, but need prevent all this crashes Wink
2  Game Development / Game Play & Game Design / Re: What's The Best Way To Define Items? on: 2015-02-18 10:23:48
say I have 1000 items, that would be 1000 classes.

You will be lost in this 1000 files )

need separate changeable values like NPC HP, Weapon Speed and DMG
and make 1-2 Files with Data that create Needed objects.

Also if you will do big project and have many ppl in Team that can change this values
They need to be separated from code
To external data format
Like XML, Excel, etc

(also its prefer separate all game Text external, for localization, etc)

p.s I use Excel to Xml and then to Code ^^
(because XML multy language format)

(for Excel i Use jexcelapi)

(also XML can be parsed to RAW data for fast load – but no one cares: its from couple ms to 1-2s load time for small project ^^)

Up:
I used something same -
this system is mega cool but you don't need it for small project )

you can't so simple create, alone, this 1000 different game object Types with Quality different texts, imgs, animations, sounds etc
(it will take so many time)

and you can implement it in any time later, so use time for something more real like playable game mechanics ^^
3  Discussions / General Discussions / Re: What's your day job? on: 2015-02-16 09:08:10
In past Software game developer in indie company XD
(even Team lead some times, but its hard call Team lead when you have so small team like 3 ppl)

(its where specific indie company shi don’t make games for self like all used to think,
Shi takes order and money - to make games for client)

Games ar HOGs - http://www.bigfishgames.com/download-games/genres/15/hidden-object.html
making them is very - very boring

but even for them - budget is 300 000 $ per middle game (Collector's Edition).

now quit (3 month ago) - tired, small salary, and want some time for coding for self ^^

up:
i feel self wrong because don't say "small salary" how is it
- i simple even don't want call that number,
but so many ppl ask self how much is "small" that I talking on )

15 000 $ per year - and you work for 3-4 different ppl ^^
- like Project Manager make Timelines
- then Like Team Lead split work for parts and watch to ppl make it in time
- Make tech art (like all animations for testing game mechanics etc)
- make Game animation except very difficult
- programming own timeline work Smiley
- and all that for 2-3 projects at once

From advantage this work:
I worked 6 hr per day 5 day per week – not 8hr, simple can’t - mind blow up after 6 there.
And 1200$ per month no so bad in place where I leave. =)

From cons:
it's very tiring.
And no chance to payment grow up there Smiley

p.s Also (chief still owns me for 2 month payment and don’t want give it back XD)
4  Game Development / Newbie & Debugging Questions / Re: convert expression for use with vecmath on: 2015-02-16 08:41:29
It doesn't. For example adding vectors v1 and v2 with v1.add(v2) stores the result in v1

Use:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
   public Vec2d add(Vec2d v){
      ....
      return this;
   }
   
   public Vec2d add_Res(Vec2d v){
      ....
      return v;
   }
   
   public Vec2d add_New(Vec2d v){
      ....
      return new Vec2d(...);
   }


p.s if you care about performance make all calculation separate by primitives) - without GC affect

1  
2  
3  
4  
v1.x = v2.x + v3.x + 10;
v1.y = v2.y + v3.y + 10;
or
(v1.add(v2).add(v3).add(10)) //but this hard for big math expression
5  Discussions / Miscellaneous Topics / Re: What is your line/char count? on: 2015-02-15 21:55:56
Old one Engine Smiley
25943 lines of code.
806716 characters.

New One. (That I rewriting)
11412 lines of code.
320973 characters.


30k lines - its big (even can't belive that i do XD)
Some times forgot how masive projects becomes, and how many time and work we trow on them ^^

p.s  (find in google Wink)
Minecraft (1.6.4), 242,138 (auto gen decompiled)
Linux have 15mil lines ^^ we still so small

Up:
^^
1  
getCharCount() = File size


This is a funny little piece of code, as it always does this for me:

1  
2  
3  
4  
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (classFileParser.cpp:3470), pid=5108, tid=5536
#  Error: ShouldNotReachHere()


... Huh

Try read file biger then hi is
- file restricted access (or used and blocked another program)
- or wrong OS Java implementation.
or broken part of hdd.

https://bugs.openjdk.java.net/browse/JDK-7144885
6  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-12 19:18:48
Aged 17 to 20?
25 ^^

Thanks for explanation of the term "half a living".
(sry some times I not fully understand abstract terms like this)
future It’s so sad theme (

But you right.
1 kid
2 beer
3 travel
4 Roof
5 food
6 savings
7 family entertainment
8 good education for your child


So many possibilities (what throw away for you’r dream XD)

p.s That normal throw away something, you’r never will have time for all you want.

This why I say:
‘that discussion have evil roots with in”
Shi don’t give nothing exept billions excuses why you don’t do what you want,
You must do this.. and that.. and wait..

you must bla-bla-bla

So selfish Lie XDDD

All I want say – I say:
“you don’t need billions money or years free time or wait something
to start doing what you want to do,or at least try it out”
 
that’s all)
And this thread is all about this – we all make what we like and sometime share it ^^
7  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-12 13:32:54
You might not realise but 90% of indies aren't even making a half a living, let alone billions of dollars.

I know Sad
I even know that 95%+ app don’t make even 100$ dollars for all they living time.

Quote
making a half a living

this is big discussion that have evil roots with in )

Tag “normal living” is different for all people

For someone its normal have 10 airplanes and if hi broke one that stop bi normal living for him.

For someone normal living its food and warm house and time for doing what hi love to do)

I don’t say that someone throw away all his dreams or something like that.

Simple take a look what you’ doing and think
do you really need billions to start doing what you want?)
or you can start doing it today.

Think about this now - because when(if) you make billions after 10+ years throw away you’r dream,
You may understand how many time you lose.

p.s Its not for someone direct its for every one and for no one ^^

pp.s About Markus – nothing personal but its so painful watch so creative man have dreams, ambitions
– want create interesting and unique games
and now hi have billions
and doing absolutely nothing – sitting all day playing games and watch streams.

Sorry Markus – nothing personal but it’s all I can see.
8  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-12 13:11:09
I just need to get our mortgage paid
I don't say that want making money is bad,
I even fully agree with you that its normal want make money for quiet life.

I want say that if you’r have money for normal living – billions dollars don’t change you’r life in better way)
(I most cases =))

And many ppl waiting this biilions for start making someting that they can start doing right now.
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-12 12:57:36
I like it Smiley

most fun quote for me:
Quote
We are legion, generally worthless, expendable, and there’s plenty more where that came from.
Quote
3 man studio in a bedroom.
XD

Imho: Its good, but totally wrong,
I have mind some time ago: that change all my life and rotate it around 360 degrees.

What you will do if you have billion dollars, how they change you'r current life?
-What you will do? except waist you'r time drink all days, watch tv, or something like that?

If you’r like programming you’r be sitting like now - all day and watch in monitor,
Do you really cares if you sit where you are now, or in Beverly hills?

Same with painting, music creation and many else creativity
You already can do 95% things in world simple in place where you are.

You already where rich!!!

p.s you may think that you hire ppl and they start making games for you,
but you’r wrong its terrible idea
– without good team and experience you lose so many mental health
– because this stupid ppl do all totally wrong ^^

The main idea is: for what you need that billions?
For start programming, or do something that you can start doing now?

Its illusion – that receiving big money you start doing something
that you CAN DO BUT DON’T WANT TO DO NOW?

Nothing will change – but with big money
you have even bigger chance that all become even harder to do
– because you will receive even more ridiculous ways to waist you’r time XD
10  Discussions / General Discussions / Re: Most graphically polished (HD)3D games developed in Java? on: 2015-02-11 23:38:10
Can we Flame about Unity ?)
i have experience with it and i know many bugs in it =)

If you want easy classification about Unity -
its good engine for hand made lvls npc, etc

but when you want make anything procedural
Unity take you for balls and go ride Roller Coaster ^^

one from problems http://blogs.unity3d.com/ru/2014/06/24/serialization-in-unity/
have more but don't remember now ^^

Up:
p.s IMHO: my recommendation about Unity : if you care about mental health - Don't USE UNITY! XD
(you can play with it, but don’t make games on it)

Take better Unreal.
(I am not sure about last Unreal ,because not use it, but I know company (and use prev versions Unreal engine),
also i know their quality standards so chance for something same stupid architecture bugs is minimum there
+ they have full open source - and if community find critical bugs: shi can fix it, even without devs)
11  Discussions / General Discussions / Re: What does this return for you? on: 2015-02-09 09:53:19
1  
2  
3  
4  
Windows XP
GeForce 9600 GT/PCIe/SSE2
3.3.0
NVIDIA Corporation

^^
I also have Win 7 for some not support software in XP but mainly use XP =)
12  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-31 22:08:21
I set up my new desk and cleaned things up. I'm loving the look.


First I think I only one, who put the monitor on the stand(books, etc ^^)
But now when I see same like 10 times from different ppl I think its normal XD
13  Game Development / Game Mechanics / Re: "Help" with RayCasting on: 2015-01-26 01:14:36
http://www.redblobgames.com/articles/visibility/
14  Games Center / WIP games, tools & toy projects / Re: LPM Online [3D Medieval Fantasy Sandbox MORPG] (Nearing Alpha?) on: 2015-01-16 13:53:21
I'm a big fan of the art in the background of the log in page

background paint using TwistedBrush filters)))
(as i can see)

but not that big of a fan of the differing image quality in various objects in the game world.

y, so dark - maybe make it same as BG =) simple add light colors and use filters from same TwistedBrush to make it funny and magical ^^

Quote
I may or may not have lost interest in the project which I cannot re-obtain...
p.s Its normal ^^ we all have many abandoned projects behind, they make as better and stronger XD
15  Discussions / General Discussions / Re: Programming Careers and Life Lessons... on: 2014-03-26 12:38:33
It hurts me to talk about it but princec rights.
Work of a programmer is not as interesting as it may seem at first glance

You're doing the same things every day – solve the same problem PRIMITIVE every day - almost no self growth or technology improvement, even if you learn something new and will use it year or two, and then you look for a new job you're surprised to see that even though you grew up and learned new technologies, but the rest world have not changed over this years, as they deal with the same problems as couple years ago.

The problem is not new technology, but the fact that they have little business needs

Businesses need a solution to his problems, rather than new technology, staff development, or something else

He needed a solution to his small constant problems and he does not care how they will solve the problems, which must be solved as fast as possible, cheaper, about the quality afterthought unfortunately.

Here's the truth : programming is not the final product - it's just a tool for the production of the final product , all users and customers do not care what language the program is written, and what technologies are used there.

The most scare and disappoint you may know is how business works – this knowledge destroy all you happy illusion.
16  Games Center / Featured Games / Re: FarSky on: 2014-01-17 19:42:20
I'm about to release FarSky Beta v2.3 today!
Tim Spekler
Неплохой проект – коммерческого успеха тебе.

Спасибо тебе за то что ты ещё раз открыл мне глаза на людей.
Это просто удивительно насколько люди эгоистичны и абсолютно не ценят труд окружающих.

И да я говорю про свой проект: нет я не говорю что он чем-то лучше твоего.
Но абсолютное безразличие на фоне твоего просто поражает,
Я никогда не просил покупать мою игру или давать мне денег – всё версии моей игры были бесплатные и без всяких комерчиских обманов через которые тупо выманиваются деньги
(которых как ни странно я знаю не мало(пре продажи с крутыми плюшками учасников , крутые рендеры ни имеющеё никакого отношения к игре, подделка счетчика продаж чтоб вызвать интерес, купленные ревю, обещания крутой механики и тд), но ни использовал ни одного)

Я даже сорс дал и как ни странно люди настолько эгоисты и неужеди так сложно проявить уважение, что даже 1 медальку не смогли дать – хотя это тупо 1 клик мышкой.
Как результат у рендера (по факту) больше гребных медалек чем у бесплатной игры с открытым исходным кодом.

Знаете что господа вам не нужны бесплатные игры, вам нравится когда вас обманывают, вы сами создаете тот говняный мир в котором вы и здохните, и нечего потом плакать.

А мне тут делать нечего с такими уродами как вы.


http://translate.google.ru
Tim Spekler
Good project - commercial success to you.

Thank you for what you have once again opened my eyes to people.
It's just amazing how people are selfish and does not appreciate the work of others.

And yes I'm talking about your project : no I'm not saying that he is any better than yours.
But absolute indifference on your background is simply amazing ,
I never asked to buy my game or give me the money - all the versions of my games were free and without any Commercial deceptions through which stupidly rook
( which oddly enough , I know a lot of (pre -sale buns of participants with steep , steep renderings nor has any relation to the game, fake counter sales to generate interest purchased revue promises cool mechanics , etc.) , but none have used none)

I even gave sors and oddly enough people are so selfish and really so hard to respect that even one could not give a medal - although it's stupid one mouse click .
As a result in the render (in fact ) more than rowing medal free game open source

Gentlemen, you know what you do not need free games , you will like it when you cheat, you create your own one shitty world in which you and die , and then there is nothing to cry.

And then I have nothing to do with such **** as you.
17  Game Development / Game Mechanics / Re: Why batch? on: 2013-12-06 19:09:40
I couldn't completely see that the article is answering my question. Tongue
GPU Have many Procces cores an shi love big fat single work, and hate many small works,

Because GPU have many cores big job like draw pixels can be separated,
but small job can make more time on giving tasks to cores and preparation then work itself.

So you must give as bigger single piece of work, as you can.

+ you also losing procces time between switching(transfer) tasks CPU – GPU.
18  Discussions / General Discussions / Re: Java "Mods" on: 2013-12-05 00:54:59
P.P.S. If someone wants to write garbage code they have no problems regardless of want language feature you chose to provide.
Agree the problems in code always goes from ppl, and programming language don’t change that.

operator overloading it bullshet, and good programmers newer should use them,
Only mega pro programmers can use it properly ^^
19  Discussions / General Discussions / Re: Java "Mods" on: 2013-12-04 07:22:56
Sigh: operator overloading is awesome...C++ problems have nothing to say about that feature.
Big Fat IMHO sorry for that:
operator overloading it bullshet, and good programmers newer should use them,
the reason behind this –
THIS FUNCTION CAN’T BE PROPERLY FINDET WITH IDE USING FUNCTION CALL SEARCH and Refactoring
+
THEY HARD TO CODE UNDERSTANDING – PPL THAT SEE YOU CODE FIRST TIME (OBj Girl + OBj Wood) = Huh

OBj Girl.Pick(OBj Wood)
OBj Girl.See(OBj Wood)
OBj Girl.StepOn(OBj Wood)

If you what short function you may do

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
int x = bla;
int y = bla;
int z = bla;
int time = bla;
.....

public My_Mega_Obj Plus_X(My_Mega_Obj a){
   this.x += a.x;
   return this;
}
public My_Mega_Obj Plus_Cord(int p){
   x += p;
   y += p;
   z += p;
}

// if you need this crap
public My_Mega_Obj Plus(My_Mega_Obj a){
   return P(a);
}
public My_Mega_Obj P(My_Mega_Obj a){
   return Plus_X(a)
}

obj_A.Plus_X(obj_B)
or
obj_A.Plus(obj_B)
or
obj_A.P(obj_B)
 
and
obj_A + obj_B = bullshet


most frequently that i need and java don't have is multy parent object, not only interface.
So I must use
Class A
Class B extend A
Class C extend B
Class D extend C
Class E extend D
Class F extend E

becouse i separate code, i hate 2k - 5k code files =)

And this is annoying
But this is architecture JVM not some restriction java compilator.
You can’t change it simple write mod for eclipse Wink

But we have many option – use alternative JVM or make new one, I am not rd for this  but this is possible ^^
20  Discussions / General Discussions / Re: Java "Mods" on: 2013-12-03 23:38:55
IMHO - I think its almost impossible if take like example unsigned ints – math operation with primitive types do Virtual machine and you can’t change it so other can simple use you application with base Oracle VM, if you change it you must provide new VM with you’r program.
You can write macro for eclipse for unsigned ints , let say that auto convert to Long, but it any case this not give you any performance, only add new visual word in code Wink
You can do same by creating class with static wrap function)

P.s I newer write eclipse plugins so I can be wrong Wink
21  Game Development / Performance Tuning / Re: Which method of drawing a line is faster? on: 2013-11-24 14:27:46
f**k Y i finaly find out this XD
offtop sorry
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
      double rad = Math.toRadians(33);
      double Cos = Math.cos(rad);
      double Sin = Math.sin(rad);
      double len = 4;
      double x = len * Sin;
      double y = len * Cos;
      //////////////////////////////////////////
      //Direction normalize
      double len_Sq = Math.sqrt(x * x + y * y);
      double invlen = 1d / len_Sq;
      double Cos2 = y * invlen;
      double Sin2 = x * invlen;
      ////////////////////////
      double x2 = len * Sin2;
      double y2 = len * Cos2;
      double len2 = (x2 / Sin2 + y2 / Cos2) / 2;
      //   x == x2, Sin == Sin2
      //   y == y2, Cos == Cos2
      //   len2 == 4
22  Games Center / Cube World Projects / Re: World of change on: 2013-11-16 20:45:55
Wait, you're still updating the game?
Sorry but no Wink

I don't think so. This thread was dead, and I believe it only woke because te author wanted to open source the old code.  Smiley
Yes )
I enter some times to answer ppl question.
23  Games Center / Cube World Projects / Re: World of change on: 2013-11-16 17:41:06
Game have both, save on Pc, and save on hosting –
 *Applet version save on Hosting, and Application save in game folder.

I do it because think Notch have same (save all worlds on Hosting Wink) it was so long time ago, and I was wrong XD
24  Games Center / Cube World Projects / Re: World of change on: 2013-09-19 22:01:02
Source release;)
Source – as is.
Code is old – 90% things write wrong XD

http://www.2shared.com/file/w6l0_0jp/S_Out.html

If any questions you can ask me =)
25  Games Center / Cube World Projects / Re: World of change on: 2013-03-27 18:08:24
My new name and game ^^ http://www.java-gaming.org/topics/polyrun-game/29126/msg/241895/view/boardseen.html#new

Game Moved on Site tunablereality[dot]p[dot]ht
+ tureal[dot]uk[dot]to
26  Game Development / Newbie & Debugging Questions / Re: Loading files after export on: 2013-03-01 01:25:38
Quote
Project/
../bin/
../bin/res/myres_IN.txt // auto moved here from /src/ when run application (Eclipse)
../res/
../res/myres_Out.txt
../src/
../src/res/myres_IN.txt

i use this =)
for in jar - wher: path = res/myres_IN.txt (../src/res/myres_IN.txt)
1  
2  
3  
      ClassLoader c = ClassLoader.getSystemClassLoader();
      InputStream is = c.getSystemResourceAsStream(path);
      if(is == null){throw new FileNotFoundException(path);}



and for out - wher: path = res/myres_Out.txt (../res/myres_Out.txt)
// need move res folder near jar when export it
out have bug - need run like "java -jar blabla.jar"
if you run from out folder like "java -jar folder_A/blabla.jar" (C:/folder_0/folder_A/blabla.jar)
java search "res" in "folder_0" not wher jar itself  (not in "folder_A")^^
1  
2  
3  
      File file = (new File(path));   
      if(!file.exists()){throw new FileNotFoundException(path);}
      InputStream is = new FileInputStream(file);

i prefer out.
27  Discussions / General Discussions / Re: Why don't many of you sell your games? on: 2013-02-24 21:39:21
IMHO:
That all is way of luck - you can create 1 project and earn millions (minecraft),
Or you can create hundreds project making money for living
and maybe money for next project  (Cortex Command, etc…),

Or even you can create projects which will be not interesting to public
and you not receive money at all (billions flash games…)
Wink
28  Game Development / Newbie & Debugging Questions / Re: Game gets slower on: 2013-01-26 14:31:31
You may use something like this

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
abstract public class D{
   static private long last_Time_N;
   static private long last_Time_M;
   
   static public long T(){
      return System.nanoTime();
   }
   static public void T_Start(){
      last_Time_N = System.nanoTime();
   }
   static public void T_Print(){
      System.out.println(System.nanoTime() - last_Time_N);
   }
   static public void T_Print(String text){
      System.out.println(text + (System.nanoTime() - last_Time_N));
   }
   
   static public long M(){
      return System.currentTimeMillis();
   }
   static public void M_Start(){
      last_Time_M = System.currentTimeMillis();
   }
   static public void M_Print(){
      System.out.println(System.currentTimeMillis() - last_Time_M);
   }
   static public void M_Print(String text){
      System.out.println(text + (System.currentTimeMillis() - last_Time_M));
   }
   
   static public long Mem(){
      Runtime runtime = Runtime.getRuntime();
      return runtime.totalMemory() - runtime.freeMemory();
   }
}

   {//game function
   D.T_Start();
   //code
   D.T_Print("code fifi time : ");
   }
29  Game Development / Newbie & Debugging Questions / Re: Game gets slower on: 2013-01-26 12:53:47
Thanks for the code!
I tested it and all values are around 9000. There are some outliers around 28000 and a few even at 40000 but they are rare. That's not too bad, right?
Yes, problem somewhere else, you need check other main functions, you must look on 100 000ns +  that 0.1 ms
In game with 60 fps 1 frame take 15 ms – 15 000 000 ns

If you have random crazy slow down that don’t have direct place that maybe
Java  memory manager (GC, allocate more memory)
Its easy to detect: because you have crazy time on simple functions like 1ms+ or so.
30  Game Development / Newbie & Debugging Questions / Re: Game gets slower on: 2013-01-26 11:30:07
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
   long t1 = System.nanoTime();
   Label:{
      if(check_Block(x - 1, y + 1, z - 1)) break Label;
      if(check_Block(x - 1, y + 1, z    )) break Label;
      if(check_Block(x - 1, y + 1, z + 1)) break Label;
      if(check_Block(x    , y + 1, z - 1)) break Label;
      if(check_Block(x    , y + 1, z    )) break Label;
      if(check_Block(x    , y + 1, z + 1)) break Label;
      if(check_Block(x + 1, y + 1, z - 1)) break Label;
      if(check_Block(x + 1, y + 1, z    )) break Label;
      if(check_Block(x + 1, y + 1, z + 1)) break Label;

      if(check_Block(x - 1, y + 2, z - 1)) break Label;
      if(check_Block(x - 1, y + 2, z    )) break Label;
      if(check_Block(x - 1, y + 2, z + 1)) break Label;
      if(check_Block(x    , y + 2, z - 1)) break Label;
      if(check_Block(x    , y + 2, z    )) break Label;
      if(check_Block(x    , y + 2, z + 1)) break Label;
      if(check_Block(x + 1, y + 2, z - 1)) break Label;
      if(check_Block(x + 1, y + 2, z    )) break Label;
      if(check_Block(x + 1, y + 2, z + 1)) break Label;
   }
   long t2 = System.nanoTime();
   System.out.println("Debug Colis time: " + (t2 - t1));/////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   
   public boolean check_Block(int x, int y, int z){
      Block b = currentChunk.getBlock(x, y, z);
      if(b != null && this.getBounds().intersects(b.getBounds())){
         this.position.x = oldPos.x;
         this.position.z = oldPos.z;
         return true;
      }
      return false;
   }
Pages: [1] 2 3 ... 5
 
BurntPizza (23 views)
2015-02-27 06:09:35

BurntPizza (20 views)
2015-02-27 05:56:17

Riven (11 views)
2015-02-27 02:34:15

Riven (18 views)
2015-02-27 01:47:26

Riven (18 views)
2015-02-27 01:46:04

BurntPizza (13 views)
2015-02-27 00:52:04

BurntPizza (15 views)
2015-02-27 00:50:29

Riven (35 views)
2015-02-26 23:38:45

Riven (12 views)
2015-02-26 23:37:24

BurntPizza (30 views)
2015-02-26 21:13:04
How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!