Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (569)
Games in Android Showcase (154)
games submitted by our members
Games in WIP (618)
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 ... 17
1  Game Development / Newbie & Debugging Questions / Re: Rotation Problem on: 2015-04-14 02:09:07
rx and ry are the rounded (to the grid) versions of the entities position to ensure the pixel stay locked into the grid. They are float values.
[edit]
And catching AIOOBE is nasty.
Yeah I know, I'll fix that when I actually start optimizing
2  Game Development / Newbie & Debugging Questions / Re: Rotation Problem on: 2015-04-14 02:02:30
Oh, Yeah it casts the float to an integer. I do it this way to keep some clutter out of the main code.
1  
2  
3  
4  
5  
6  
7  
8  
9  
public static Tile get(float x, float y) {
      Tile got = null;
      try {
         got = tiles[(int) x][(int) y];
      } catch (ArrayIndexOutOfBoundsException e) {
         return null;
      }
      return got;
   }
3  Game Development / Newbie & Debugging Questions / Re: Rotation Problem on: 2015-04-14 02:00:01
Thanks for the replies! I'm going to look over these sources and try this stuff out!
@BurntPizza Game.get return the tile located at the coordinates specified
4  Game Development / Newbie & Debugging Questions / Rotation Problem on: 2015-04-14 00:17:47
So i have this problem when rotating entities in my program. It seems some tiles are omitted from the rotation in any degree value that is not 90,180,270, or 360. Which I kinda expected, but I can't figure out how to fix it.  Huh
Click to Play


I am rotating a 2d array of tiles:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
for (int x = 0; x < texture.getTexture().getWidth(); x++) {
         for (int y = 0; y < texture.getTexture().getHeight(); y++) {
           
            Vector2 rotate = rotate(new Vector2(x-width/2,y-height/2));//Rotate points about center
            float x1 = Math.round(rotate.x+width/2);//round and translate
            float y1 = Math.round(rotate.y+height/2);//round and translate
            Tile t = Game.get(this.rx / Tile.gridSize + x1, this.ry
                  / Tile.gridSize + y1);//get grid tile
            Color c = texture.pixelData[x][y];//get grid color
            if (c.a > 0 && t != null) {
               t.type = Type.BLOCKED;//make sure tile is solid
               t.r1 = c.r;//assign color to tile
               t.g1 = c.g;
               t.b1 = c.b;
            }
            within[x][y] = t;//assign tile to list
         }
      }


rotation method:
1  
2  
3  
public Vector2 rotate(Vector2 point){ 
      return point.rotate(rotation);
}


Any help would be awesome!
5  Games Center / WIP games, tools & toy projects / Re: 2D Terrarian engine on: 2015-04-13 20:42:46
Yeah I know but I'm trying to challage myself a little by doing it this way.  Pointing
6  Games Center / WIP games, tools & toy projects / Re: 2D Terrarian engine on: 2015-04-13 20:30:49
Thanks,  I'm glad you like it Smiley
7  Games Center / WIP games, tools & toy projects / 2D Terrarian engine on: 2015-04-11 18:50:47
Hey guys,

So I decided to start a topic for this project after I implemented the probably unique (I haven't seen it anywhere else) fluid system. Here is some gifs showing off the current features:

Lighting (Direction + Brightness):
Click to Play

Fluids:
Click to Play

Distortion of Through Fluids (An unexpected plus with the fluid system Smiley):
Click to Play


And a video(60fps):
<a href="http://www.youtube.com/v/sNNcfD1qGlk?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/sNNcfD1qGlk?version=3&amp;hl=en_US&amp;start=</a>

Also, I didn't use any shaders.  Cool

Planned features:
- Entities
-
8  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-11 00:31:14
I added particles and fluids (WIP). I'm trying out something different with fluids. This system doesn't use any "concrete collision" (for a lack of a better term) but it can emulate the look and pressure of water. I'm not sure if I like how it looks yet  but I'm not done tweaking it. I also added directional light and ambient light (not shown in gif)
Click to Play


[Edit]
Took my best shot at the Kool-aid man  Cool->
9  Game Development / Newbie & Debugging Questions / Re: Camera "Tweening" on: 2015-04-10 05:33:22
I would guess that the target position would be the current camera position plus an offset for movement.
10  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-10 02:51:33
If you are mixing colors, they do have to potential to become white under high intensities. You can't see it in my picture but if I raise the intensity of all the lights, they will mix together and may become white if enough colors are involved:


Try lowering the brightness of the lights. It may solve your white problem.
11  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-10 01:33:16
I realized that I wanted to finish only one part of Astrofirm: the lighting  Cranky. So I totally recreated the lighting system and improved upon upon it a bit.
First I made it in much less code and, I made lights able to change their intensity (yup couldn't do that on the old system). So in the end, not much has changed in the look, but I'm going to keep tweaking it until it.

12  Discussions / General Discussions / Re: Which Smartphone should I choose??? on: 2015-04-08 15:38:53
Phone Arena

Even though I dont like the Samsung interface, I would say go with the Galaxy. The Galaxy phone has a higher pixel density and more internal storage (which is very important). But above is a link comparing those 2 phones plus a 2015 Moto E. Just look over the specs and get the one that you prefer.
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-04-07 21:54:24
So I haven't done much coding over the past week or so but a couple weeks ago my friends and I entered our an app at our TSA state conference and won 3rd place which was nice  Cool. But today I was internet hopping and found this beautiful post (#4 is what got me  Smiley ).

Oh and next week my school Vex Robotics team is competing in the world's competition for the third year in a row. (Our schools vex program has only been around for three years - me being in 2 - so that's pretty cool  Cool)
14  Discussions / General Discussions / Re: Does Internet cost matter to you? on: 2015-04-05 13:31:43
Is internet cost even by data anymore (atleast in America)? I don't pay for my internet (being 16 and all) but I'm pretty sure my parents just pay a flat rate for internet speed. It may he different in other countries but I don't really care about how much data I consume.
15  Game Development / Game Mechanics / Re: Orbital mechanics = Keplers! on: 2015-03-17 21:10:42
I actually tried to simulate orbital gravity in the past by creating a grid with different gravitational values and objects would move to the tile with the greatest grid value. It actually turned out pretty good but sometimes orbits would flip and all large bodies had the tendancy to move to the upper left unprovoked. Still really interesting experiment.
16  Game Development / Newbie & Debugging Questions / Re: [Android] App Wont show in App Drawer after debug on: 2015-03-15 21:58:58
Ok im going to bump this topic because after a week of searching for an answer to the problem, nothing has come up. If anybody even has an idea about where to start fixing the problem I would be very grateful;

Also, even release apks have the same problem  Sad

edit: just to clarify, the app debugs without flaw, the only thing I can't do is relaunch the app after I'm done debugging it. Eclipse let me run the apk after I was done debugging so why doesn't Android studio?


Never mind found the answer  Cheesy
17  Discussions / Miscellaneous Topics / Re: Android Studio comedy of errors on: 2015-03-09 22:49:51
I also had some trouble installing Android Studio on my Windows Machine but when I did, the benefits definitely out weighed the problems. That being said, however, I still prefer eclipse when coding libgdx apps.
18  Game Development / Newbie & Debugging Questions / [Android] App Wont show in App Drawer after debug on: 2015-03-08 20:39:54
Hey guys, so I have a small problem when debugging my app from Android Studio. When I run the app, everything runs fine but, when I close the app, the app does not show up in my app drawer. This only happens when I run an app from Android Studio as any apps I'm developing in Eclipse, show up in the app drawer (which makes me think there is nothing wrong with adb).

So small problem, but I'm not able to show the progress of the app to my partners. Any help would be awesome.  Smiley 
19  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-03 01:21:21
Got my 2d Gen Moto G last week (and I love it  Grin ). I also am putting the finishing touches on my app, signed up for AdMob and let some friends test it out (they all to seem to love it  Smiley). The last thing I have to do is create a personal bank account for aAdMob Woo!  Pointing
20  Discussions / Miscellaneous Topics / Re: Yay, free games! Zero's Game Giveaway on: 2015-02-23 19:03:02
I took olioli thanks  Grin
21  Discussions / Miscellaneous Topics / Re: Yay, free games! Zero's Game Giveaway on: 2015-02-22 14:22:32
I took Dust. Thanks man  Cool
edit: mine doesnt work either  Huh
22  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-22 01:17:25
I finished all game play elements in my first android game! Woo! (Although they are very simple). Now just some simple sound and some ads and boom! google play store here I come! Pointing I'll post it here when it gets published.

Also, in LibGDX is there any way to call a method in my AndroidLauncher class from my core class?
23  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-18 18:04:10
Made a twitchy shooter yesterday.
*1.8mb gif*
Click to Play
24  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-16 23:05:51
@Mike you should add a automatic waypointed scroll system like on the Moto G webpage
25  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-14 02:56:40
I made a simple and customizable text highlighter:

26  Game Development / Newbie & Debugging Questions / Re: Strategies for Handling Large Tile Maps? on: 2015-02-07 12:39:25
Find a balance between chuck size and performance and only draw the chunks which are on the screen. You could go further and also only draw each tile that is not on the screen but when there is nothing in a chunk, make sure the chunk itself I checking whether or not if any of its tiles are on the screen instead of looping through the whole lust when nothing should be showing up anyway. So:
1. Loop through chunks and if chunk(s) area is on screen start looping through blocks inside chunk(s) else disable chunk rendering
2. Check if blocks within chunk(s) are on screen and if so, draw them
3. Repeat

This should help you. I think this is similar to how minecraft renders chunks but I'm not sure.
27  Game Development / Newbie & Debugging Questions / Re: Weird Array Bug on: 2015-02-05 03:12:13
Is this better? :

1  
2  
3  
4  
5  
6  
7  
8  
9  
public static Grid getGrid(float x, float y) {
      Grid r = null;
      if (x < channels.length && y < channels[0].length && x > 0 && y > 0) {
         r = channels[(int) x][(int) y];
      } else {
         r = new Grid();
      }
      return r;
   }
28  Game Development / Newbie & Debugging Questions / Re: Weird Array Bug on: 2015-02-05 03:08:04
Every value is well above 10

Also, How do I handle Out Bounds Exceptions then?
29  Game Development / Newbie & Debugging Questions / Weird Array Bug on: 2015-02-05 03:00:00
Hey guys,

I'm having this really obnoxious bug in a 2d array. Getting array data only works when searching with a positive increment.

Find Grid Code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
   public static Grid getGrid(float x, float y) {
      Grid r = null;
      try {
         r = channels[(int) x][(int) y];
      } catch (ArrayIndexOutOfBoundsException e) {
         r = new Grid();
      }
      return r;
   }


Here is where the problem is:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
   public void findNeighbors() {
      if (!found) {
         north = Game.getGrid((int) position.x / 10, (int) (position.y / 10) - 1);// not
                                                               // working
         east = Game.getGrid((int) position.x / 10 + 1, (int) position.y / 10);// working
         west = Game.getGrid((int)( position.x / 10) - 1, (int) position.y / 10);// not
                                                               // working
         south = Game.getGrid((int) position.x / 10, (int) position.y / 10 + 1);// working
         found = true;
      }
   }


The program is only working when getting the east and south tiles.

I just don't understand why this could be happening.
30  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-30 01:41:49
Learned and implemented Parse in my android app  Tongue
Pages: [1] 2 3 ... 17
 
Riven (21 views)
2015-04-16 10:48:47

Duke0200 (34 views)
2015-04-16 01:59:01

Fairy Tailz (25 views)
2015-04-14 20:13:12

Riven (26 views)
2015-04-12 21:36:37

bus hotdog (44 views)
2015-04-10 02:39:32

CopyableCougar4 (45 views)
2015-04-10 00:51:04

BurntPizza (45 views)
2015-04-06 22:06:58

ags1 (49 views)
2015-04-02 10:58:48

Riven (49 views)
2015-04-01 18:27:05

ags1 (66 views)
2015-03-31 10:55:12
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!