Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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: Y-axis acting differently from x-axis in libgdx on: 2013-02-11 08:05:18
So, I found this post. http://stackoverflow.com/questions/8104364/apply-pixel-coordinates-to-screen-coordinates
I did the unproject thing and now it works! (not entirely sure what it does though)
2  Game Development / Newbie & Debugging Questions / Re: Y-axis acting differently from x-axis in libgdx on: 2013-01-28 18:44:03
Yes I could probably simplify it a bit. The reason I added * 1f was because I needed it to be a float but I should probably just use (float) haha. The reason I divide by height and width is because the coordinates are between 0 and 1. 0 is one end of the screen and 1 is the other. I calculate the coordinates of the object and then I divide it to get the coordinate that the system wants. But I think this is all irrelevant, since the code for the x and y-axes are identical except for x and width being replaced by y and height. The x-axis works perfectly so by my logic the y-axis should work perfectly too. But it won't Sad
    Diag is supposed to become sqrt(0.5) and when I printed it before it seemed to work. Although I'll test that once this problem is solved since now the speed when going up and down is different from going right to left so I can't really measure it properly.
    I'll try commenting out the orthographic camera but that was in the example program when I got it so I'd expect it to work.
    Edit: The only thing that happened when I removed the camera was that nothing appeared.
3  Game Development / Newbie & Debugging Questions / Y-axis acting differently from x-axis in libgdx on: 2013-01-28 08:18:30
First of all, hi, new here.

This doesn't have to do with different origins in the coordinate systems (afaik), I already accounted for that.
A previous post on the issue. http://www.reddit.com/r/javahelp/comments/174i55/yaxis_movement_behaving_differently_from_xaxis/
The code. http://pastie.org/5894953
I'm using libgdx for this and it's just an icon that you can move either by using your arrow keys or by holding down your mouse button. The problem is that when I use setPosition() in both movement-ways the function seems to add/remove a couple of pixels. I have printed the position before setting it and once I set it it doesn't end up where it should be.
It's as if when I use setPosition() it multiplies the Y-value by 1.1-ish in both ways I implemented it. I don't have 1.1 (or any number like it) anywhere in the code and when I check the variable right before sending it to setPosition it is correct. Setting it to fullscreen didn't help.
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (38 views)
2014-10-17 03:59:02

Norakomi (29 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (57 views)
2014-10-14 00:39:48

TehJavaDev (56 views)
2014-10-14 00:35:47

TehJavaDev (47 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
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

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!