Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (701)
Games in Android Showcase (203)
games submitted by our members
Games in WIP (774)
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]
1  Game Development / Newbie & Debugging Questions / Re: LibGDX tilemap smoothing on: 2016-11-19 19:40:26
Oh, had wrong link first, not the .png one. Now, the pic works.  Roll Eyes

So bilinear filtering, as it is described

"Bilinear filtering is a texture filtering method used to smooth textures when displayed larger or smaller than they actually are. Most of the time, when drawing a textured shape on the screen, the texture is not displayed exactly as it is stored, without any distortion."

I really dont see, how could I use this with two tiles transition. But oh well, have to do some research more. Thanks for the input tho Smiley.

_Tumppu_
2  Game Development / Newbie & Debugging Questions / LibGDX tilemap smoothing on: 2016-11-19 15:11:15
Hi again, it's been a while.

Soo, I have been messing around with a Simplex Noise, and made kinda like a map.It's built with tiles in 2D array as the pic shows, so it really isn't that good looking.  

edit. hmmmh. Forumn doesn't support ImgUr?
anyway. here is the pic:



http://imgur.com/3KAaamm

So I was just wondering if someone could give me some pointers on how to kinda like smooth tiles out, blending or so. I have read about texture splattering and have tried to implement some with Alpha mask texture. With one tile it's fine (because they are top on each other), but I just cant get it, how Can I smooth transfer like grass -> stone [grass][stone] if they are next to each other . Should I some how check the neighbours and create a mask that blends with neighbours texture? Or is there some other way? No, I dont want to draw tiles for different transforms or so.

Thanks in advance Smiley

_Tumppu_
3  Game Development / Newbie & Debugging Questions / Re: Delayed rotation on: 2012-09-28 04:49:32
Yeh, I noticed that little bug Smiley. Gonna try and fix it by myself Tongue. Thank you very much again Smiley
4  Game Development / Newbie & Debugging Questions / Re: Delayed rotation on: 2012-09-27 21:04:25
Haha

Well you have this.angle.
You could make another variable this.currentangle

then use something like this:

1  
2  
3  
4  
5  
6  
7  
8  
float diff = this.angle - this.currentangle;
if(diff < 0){ diff += (float)Math.PI * 2; }

if(diff < Math.PI){
    this.currentangle += 0.01f;
}else{
    this.currentangle -= 0.01f;
}


You check the diffrence between the current and the destination angle.
If its close to the right, move right, else move left.

I always mess up + and - so you might need to switch the variables Smiley

Thanks dude! That works veeery nicely! Smiley
5  Game Development / Newbie & Debugging Questions / Re: Delayed rotation on: 2012-09-27 20:56:41
Haha

Well you have this.angle.
You could make another variable this.currentangle

then use something like this:

1  
2  
3  
4  
5  
6  
7  
8  
float diff = this.angle - this.currentangle;
if(diff < 0){ diff += (float)Math.PI * 2; }

if(diff < Math.PI){
    this.currentangle += 0.01f;
}else{
    this.currentangle -= 0.01f;
}


You check the diffrence between the current and the destination angle.
If its close to the right, move right, else move left.

I always mess up + and - so you might need to switch the variables Smiley

Heh okay thx. That's seems easier Smiley
6  Game Development / Newbie & Debugging Questions / Re: Delayed rotation on: 2012-09-27 18:15:24
Ugh, dunno how to implement this....
7  Game Development / Newbie & Debugging Questions / Re: Delayed rotation on: 2012-09-27 16:20:06
Well thanks Smiley, I will take a look at it
8  Game Development / Newbie & Debugging Questions / Delayed rotation on: 2012-09-27 16:06:48
Hi there all

This is my first post and don't care about my spelling, English is not my native
language Smiley.

So I'm creating just a little tank game, everything is fine, tank is moving and cannon turning.

The problem is

1  
2  
3  
4  
5  
6  
7  
   
public void setDirection(float x, float y) { // parametres are mouse x,y
     
   float rx = x - this.getX();
   float ry = y - this.getY();
   this.angle = (float)Math.atan2(ry, rx); // cannon angle
}


This rotates the cannon okay, but, I would like to have some kind of delay to that turning (I mean, now
it's instant.
How is such a thing even possible? Somehow with delta time? I suck at math and physics sooo. Smiley

Well, if someone could help, I would really appreciate that!

Thanks in advance Smiley

edit. I try to explain better...

The cannon is now facing direction x,y
When I move the mouse, the facing direction changes of course to nx,ny.
I want it to be so that cannon slowly rotates to the new facing direction... Smiley
Pages: [1]
 
ral0r2 (189 views)
2016-11-23 16:08:26

ClaasJG (330 views)
2016-11-10 17:36:32

CoffeeChemist (423 views)
2016-11-05 00:46:53

jay4842 (475 views)
2016-11-01 19:04:52

theagentd (486 views)
2016-10-24 17:51:53

theagentd (474 views)
2016-10-24 17:50:08

theagentd (432 views)
2016-10-24 17:43:15

CommanderKeith (429 views)
2016-10-22 15:22:05

Roquen (400 views)
2016-10-22 01:57:43

Roquen (302 views)
2016-10-17 12:09:13
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21
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!