Java-Gaming.org Hi !
Featured games (88)
games approved by the League of Dukes
Games in Showcase (679)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (734)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2 3 ... 10
 1 
 on: 2016-05-29 20:44:00 
Started by bmanmcfly - Last post by bmanmcfly
First, thanks alot, thats actually how I got the movement going so far, but just needed to brainstorm on a method of getting the next line segment once crossed.

Just build a representation of the floor of line-segments and represent the player as an line cross or any other shape.
If the player doesn't collide he's falling.
If the player collides, determine what line he collided with and determine the lines normal vector
1  
(nx,ny) = (-(l.x2-l.x1),l.y2-l.y1)
For this specific formula to work, your line-endpoints must be sorted so that the left point is (x1,y1) the normal-vector will be flipped 180 degrees otherwise.

That's why I had decided to use polylines as an overlay on the ground lines (which I will be able to add complexity to, I had just made a basic map so that I can test as I go through the process), this way I can easily sort the lines from left to right, and better, sort it into an array where each "block" of terrain can have an array of line segments.  Then, on collision I get the correct block and line segment, and once I pass the bounds of the one line segment I look for the next line segment for the new angle.

The way I get the direction to move is just
1  
2  
direction = lineEnd.sub(lineStart);
direction.nor();

(sub is subtraction, nor is normalize, which is the same code as you put)



Quote
Let's say the player is going left or right while colliding, this means he either travels parallel to the line or cannot go further up because it's too steep
You need to calculate the tangent vector that fits your desired movement direction, it's either
1  
(tx,ty) = (-nx,ny)
or
1  
(tx,ty) = (nx,-ny)

after you have that just move the player along that vector by doing
1  
(px,py) += (tx,ty).normalize().scale(speed).scale(deltaTime)

If it's steep and the player should be falling, just move him like above but with the falling speed.

This was going to be the next step, once I get the direction of movement correct, I was gonna have to think of a way to scale the speed going up or down slopes based on the angle, and probably a threshold where the player would slide down too steep of a slope.

btw, I have the diamond shaped polygon for collision detection, and it didn't show up in the picture, but I have the 4 square corners as defined points as well so that the player wont drop off an edge premature.


The names in the text do not fit the names in the picture!
[/quote]

Thanks alot for those pointers, its confirmation that I'm on the right track.  I really appreciate the help, I'm hoping to get things moving so that I can finally put something up as a WIP.


 2 
 on: 2016-05-29 15:55:41 
Started by Ecumene - Last post by Ecumene
Some information about helping with the project:

If you're interested and have some good insight on features, create an issue on either the io or main repository or simply make a pull request! If you're interested in making pull requests like that more frequent, email me to be added to the github team: mitchell.hynes@ecumene.xyz

 3 
 on: 2016-05-29 15:54:45 
Started by SplendidDuck - Last post by SplendidDuck
The inventory system... make it scroll or something. I do NOT want to press each individual page in search of items.
That's a fair point, I'll look into it. My concern with a scrolling inventory is that items can become hard to find in the middle (if the inventory is big enough) There's more I'd like to add to the inventory such as filtering by type and quick searching but I haven't found the time to get round to it yet

 4 
 on: 2016-05-29 15:48:42 
Started by Ecumene - Last post by Ecumene


JGLOOm stands for Java openGL: Object Oriented (man!) it is Java library that wraps the functionality of the OpenGL API in a more object-oriented package. It puts OpenGL objects into Java interfaces, and their functions into static factories / container utils, allowing for code to be reactive to the user's OpenGL version/platform dependency. It also provides users higher-level utilities like tracker objects that follow OpenGL values (like a texture parameter) around, reducing API calls.

Repository for the wrapping of OpenGL objects into java interfaces (with utilities)
https://github.com/team-jgloom/jgloom-io
Repository for loading file formats into those objects (no work has been done here yet)
https://github.com/team-jgloom/jgloom

Currently the library is in pre-production and we're working on the standard for it. Here's some stuff we have done though:
1  
2  
3  
4  
5  
6  
GLBuffers - Interface and Containers
GLTextures - Interface and Containers
GLFrameBuffers - Interface and Containers
GLRenderBuffers - Interface and Containers
GLSLShaders - Interface and Containers
GLSLPrograms - Interface and Containers


Here's how an object looks in our library
1  
2  
3  
4  
public interface GLBuffer {
    /** @return The identifier for the buffer object */
    int getBuffer();
}

Along with some static functions following after it, that's it!

The focus of this library was not just the higher-level manipulation of OpenGL objects, but also loading popular file formats such as these:
Image formats
  • JPEG
  • PNG
  • TIFF
  • GIF
  • BMP


Model formats
  • MD5 - Animations and all
  • OBJ
  • FBX
  • Collada - We intend to use [JCollada](http://javacollada.sourceforge.net/)
  • Blend - In the very far future, as a tech demo (it would be very hard)

Behold the power of the higher level!


Lambdas:
1  
2  
3  
4  
public GLBuffer getMyBuffer(){
    int buffer = GL15.glGenBuffers();
    return () -> buffer;
}


Easier manipulation of our future file loaders:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
OBJMesh myMesh = OBJMeshes.loadMesh(new File("not.implemented.yet.obj"));
FloatBuffer myFloatBuffer = myMesh.getVertices(); // A Float buffer completely decoupled from OpenGL

InterleavedModel batch = new InterleavedModel(... parameters???);
batch.put(myMesh); // Interleaves it's floatbuffers with everything else

// Here's the good part: Everything is decoupled from the OpenGL draw methods, so you can use any version you want
void render() ...
GLStaticRenderingThingyUsingGL11.render(batch);
or
GLStaticRenderingThingyUsingGL30.render(batch);


More examples to come.

 5 
 on: 2016-05-29 14:28:39 
Started by Ranger - Last post by Ranger
That's weird.  The game runs on Google App Engine, so one would hope they have their internet all sorted.

 6 
 on: 2016-05-29 13:40:42 
Started by Ranger - Last post by basil_
o/

"Sorry, I can't connect to the server. Please check your internet connection and try again."

FF is using a http proxy.

 7 
 on: 2016-05-29 12:34:39 
Started by noctarius - Last post by basil_
multiple inheritance of behaviour
sounds schizophrenic Wink

 8 
 on: 2016-05-29 11:40:02 
Started by BurntPizza - Last post by kingroka123
I graduated high school yesterday  Cheesy

 9 
 on: 2016-05-29 11:00:34 
Started by noctarius - Last post by Icecore
Multiple inheritance was a pre-existing feature of C++ that was explicitly excluded from Java from the very beginning because of the problems it can cause. Personally I see no need to add it to the language now.
I think its ok - after i found out this solution ^^ - So I think problem closed - with little overhead of code(And Mem)
All thanks Wink
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
interface B{public B_Data get_B_Data();}
interface C{public C_Data get_C_Data();}

class B_Data implements B{public B_Data get_B_Data(){return this;}}
class C_Data implements C{public C_Data get_C_Data(){return this;}}

class BC_Data implements B, C{
  B_Data bd;
  public B_Data get_B_Data(){return bd;}
  C_Data cd;
  public C_Data get_C_Data(){return cd;}
}

Or even little crazy Sugar =)
1  
2  
3  
4  
5  
6  
7  
class BC_Data_Ex implements B, C{
  B bd = new B_Data();
  public B_Data get_B_Data(){return bd.get_B_Data();}

  C cd = new BC_Data();
  public C_Data get_C_Data(){return cd.get_C_Data();}
}

 10 
 on: 2016-05-29 10:38:47 
Started by BurntPizza - Last post by J0
Hi lads! Smiley

I finally finished — or rather nearly finished — my decent bone animation tool! And I'm super happy with it, too. Hopefully I'll be able to, at last, make not-too-bad looking running animations Pointing And a hell lot of other things, too!

Here's how I initially tried to make animations persecutioncomplex

full size

Then I moved on to:

full size
(even Imgur thinks it's stupid, the pic link says "LOwlL")

And now I finally have:

full size

J0 Smiley

Pages: [1] 2 3 ... 10
 
DarkCart (19 views)
2016-05-29 02:30:33

Hydroque (36 views)
2016-05-26 14:45:46

Mac70 (47 views)
2016-05-24 21:16:33

theagentd (52 views)
2016-05-14 18:38:35

theagentd (85 views)
2016-05-10 22:37:41

theagentd (91 views)
2016-05-10 22:33:46

IanParcs (119 views)
2016-04-18 14:18:53

KaiHH (115 views)
2016-04-18 08:35:41

KaiHH (135 views)
2016-04-15 12:43:58

theagentd (141 views)
2016-04-14 02:16:17
FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50
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!