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] 2
1  Java Game APIs & Engines / Android / Re: Deploying libgdx for android on: 2013-04-10 23:53:29
When you use the setup UI it will generate an <Profject_Name>-android project. If you run that, it will create an APK in that project's /bin folder.

Thanks you, hadn't realised that Smiley
2  Java Game APIs & Engines / Android / Re: Deploying libgdx for android on: 2013-04-10 19:14:36
Where do I find that?

EDIT: But that just sets up the project, I mean actually deploying and outputting an apk for android
3  Java Game APIs & Engines / Android / Deploying libgdx for android on: 2013-04-10 18:11:59
Can anyone point me to a good guide for deploying with libgdx on android?
I tried looking at the libgdx wiki and the section on deploying for android wasn't very clear...

Thanks!
4  Game Development / Game Mechanics / Re: Level creator on: 2012-05-24 21:37:54
I'm making a sidescrolling platformer, which is what I gather you're making, a tile map, should be fine for doing a sidescroller, it's what Im using, plus its easy to do everything can be stored in a 2 dimensional array.
5  Game Development / Game Play & Game Design / Re: [Help]Platformer Pathfinding on: 2012-05-07 10:46:42
Quote
The same way you simulate the movements for the player? We're rapidly getting into "write my game for me" territory I think. What have you tried? What didn't work?

For jumping, I originally had the enemy follow a bezier curve between the two waypoints. Later I changed it to just simulate a proper jump - finding the launch speed and angle is the only tricky bit, but that's just a bit of trig really.

What I meant was, I'm not simulating the movement for my player, I'm just moving them, by simulating I assume that means playing through possible movements without actually moving the NPC and seeing which one is best, I'm not asking anyone to write my game for me, as then I wouldn't learn anything and I couldn't feel pride in the final product, I'm sorry if it came across that way, but this is my first real game attempt and I'm new to this...
6  Game Development / Game Play & Game Design / Re: [Help]Platformer Pathfinding on: 2012-05-07 10:12:58
How would I go about simulating the movements?
It would mean anticipating collision, the NPCs knowing when/where to jump...
Also, in the future I want to have some team-mate NPCs who follow and fight with the player,
would a similar system work for this?
7  Game Development / Game Play & Game Design / Re: [Help]Platformer Pathfinding on: 2012-05-06 22:14:39
A* can be used on any graph to find a route from one node to another, not just top down maps. You just need to find a way of representing your platform level as a suitable graph that can be traversed.

Previously I've done that by generating waypoints at regular intervals along the surface of the platforms, then generating links between adjacent waypoints, like this:

Here, the greed diamonds are waypoints and the white lines the available routes between nearby waypoints. You'll need to generate links not just from waypoints on the same platform, but between waypoints on different platforms that you can jump between.
How would I make this look natural, so the entity doesn't just fly there following straight lines, it jumps, and the jump curves like a normal jump...?
8  Game Development / Game Play & Game Design / Re: [Help]Platformer Pathfinding on: 2012-05-06 16:28:42
Yeah, But that wouldn't really be what I was aiming to achieve, I know it's simplest, but it's not really what I'm looking for... I'll keep it in mind though thanks Smiley
9  Game Development / Game Play & Game Design / [Help]Platformer Pathfinding on: 2012-05-06 15:48:34


I've been thinking about how to do path finding for my 2D platformer, I want the enemies to be able to find their way towards the player and jump on to higher platforms to reach them... I looked into the A* algorithm but it seems to be more suited to top down games and I was wondering if anyone had any good ideas regarding platformer pathfinding?
10  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-26 15:29:06
I'm now trying to figure out how to smooth the shadows, so they're not so sharp... I thought about having it check all the tiles that the torch has lit and checking if they have any unlit tiles next to them, if they do, changing the unlit tile's light value to something slightly higher... but that'd be messy...
11  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-26 06:46:21
I've solved the problem, I used (int) instead of Maths.abs  for some strange reason, can't work out what I was thinking... maybe it was too late for my brain to work properly... who knows?
12  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-25 21:38:10
Ok, I'll post up the code now, it's not working for the top left hand side, when the line gets past the tile above the one that I'm checking from...
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  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


package kingdom.blue;

import java.awt.Point;
import java.io.IOException;
import java.net.URL;
import javax.imageio.ImageIO;

/**
 *
 * @author Tom
 */

public class TileTorch extends Tile {

    public TileTorch(int x, int y, map m){
        lightLevel = 5;
        floorBlock = false;
        lightSurroundings(x,y,m);
    }
   
    public void lightSurroundings(int x, int y,map m){
       
        int firstx = x-4;
        int firsty = y-4;
       
       
        for(int x1 = firstx;x1 < x+4;x1++){
            for(int y1 = firsty;y1 < y+4;y1++){
               if(tileVisible(x,x1,y,y1,m)){
                   if(x1 > -1 && x1 < map.WIDTH){
                       if(y1 > -1 && y1 < map.HEIGHT){
                            if(m.Map[x1][y1] != null){
                                m.Map[x1][y1].lightLevel = 5;
                                System.out.println("lighting tile!");
                            }
                        }
                    }    
               }
            }
        }

    }
   
   
    public static boolean tileVisible(int x1, int x2, int y1, int y2, map m){
       
        int xinc1;
        int xinc2;
        int yinc1;
        int yinc2;
        int abs;
        int den;
        int num;
        int numadd;
        int numTiles;
        int deltax = (int)(x2 - x1);          
        int deltay = (int)(y2 - y1);        
        int x = x1;                                
        int y = y1;                                

        if (x2 >= x1)                          
        {
            xinc1 = 1;
            xinc2 = 1;
        }
        else                                              
        {
            xinc1 = -1;
            xinc2 = -1;
        }

        if (y2 >= y1)                          
        {
            yinc1 = 1;
            yinc2 = 1;
        }
        else                                              
        {
            yinc1 = -1;
            yinc2 = -1;
        }

        if (deltax >= deltay)          
        {
            xinc1 = 0;                              
            yinc2 = 0;                              
            den = deltax;
            num = deltax / 2;
            numadd = deltay;
            numTiles = deltax;          
        }
        else                                              
        {
            xinc2 = 0;                              
            yinc1 = 0;                              
            den = deltay;
            num = deltay / 2;
            numadd = deltax;
            numTiles = deltay;          
        }

        for (int currentTile = 0; currentTile <= numTiles; currentTile++)
        {
            if(x > -1 && x <= map.WIDTH){
                if(y > -1 && y <= map.HEIGHT){
                    if(m.Map[x][y] != null){
                        if(m.Map[x][y].lightBlock){
                            return false;
                        }
                    }
                }
            }
            num += numadd;                          
            if (num >= den)                      
            {
                num -= den;                    
                x += xinc1;                    
                y += yinc1;                    
            }
            x += xinc2;                          
            y += yinc2;                          
        }
        return true;
    }

}


Now I really am off to bed, I'll check back in the morning...
13  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-25 21:29:21
Oh, looks like some angles/lines may not be working... oops, will just check that out...
EDIT: Yeah it looks like when the line goes upwards and to the left it's not working... need to check why that is...
I'll post up my code and possibly some screenshots tomorrow, so you can see what's happening, for now Im off to bed, as I am tired...
but it's looking better than yesterday Smiley
14  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-25 21:26:56
Nah, it seems to be working fine now, thanks, I'll fiddle around with it, to get it looking exactly how I want it, but the hard work I feel is pretty much done for now, I shall clean up my code and post it up, in case anyone else wants a peek at it...
Thanks for all the help! Everyone's been really helpful. I'll probably make a thread about my Game at some point so I can post more about it...
15  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-25 21:19:06
Nothing shows up... I was using 2 for loops to run through the x/y positions I wanted to check for lighting...
EDIT: Oh, It was due to a stupid error I made... no worries, seems to be working great Cheesy - Just need to clean it all up now, bit messy currently
16  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-25 21:02:24
Well, I've got no errors, however my program just sits there on load... I think that it may be a little slow...
17  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-25 20:49:08
hmm... I've changed it to that and it's now not working... the joys of bug fixing, here I come!
EDIT: Derp, just didn't change what I was printing to system xD may be why...
18  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-25 20:35:32
To use it for tiles would it be exactly the same, but I just have to supply it with tile numbers instead of pixels then at the end check for tile numbers instead of the mess of code I currently have?
19  Game Development / Game Mechanics / Re: 2D tiled map on: 2012-04-25 20:15:01
Well without seeing your code I wouldn't know, is there anywhere in your game which only gets called once? where you could just call Map.render or whatever?
20  Game Development / Game Mechanics / Re: 2D tiled map on: 2012-04-25 20:08:12
Uhh only call it when setting up the game/level?
21  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-25 20:01:41
Right well currently it's working on pixels... so yeah... I guess I should change that
22  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-25 19:21:38
Well, because the tile map moves, you need to make it relative to the tile map rather than the canvas surely?
EDIT: Also, shouldn't that code at the bottom work then?
23  Game Development / Newbie & Debugging Questions / Re: Java2D drawing colored bitmap fonts on: 2012-04-25 18:50:03
I'd be tempted to take a look at Notch's code for Prelude of the Chambered, pretty sure he did it in there... in particular I'd look at the Art and Bitmap classes... think that's where it's handled.
24  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-25 18:42:12
First attempt didn't work -
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
public static boolean tileVisible(int x1, int x2, int y1, int y2, map m){
       
        int deltax = x2 - x1;
        int deltay = y2 - y1;
        int y = y1;
        int ynum = deltax/2;
        for(int x = x1; x <= x2; x++){
            if(m.Map[(int)(x-m.mapPosX)/m.TILE_SIZE_X][(y-m.mapPosY)/m.TILE_SIZE_Y].lightBlock){
                return false;
            }
            ynum+= deltay;
            if(ynum >= deltax){
                ynum -= deltax;
                y++;        
            }
        }
        return true;
    }
25  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-24 19:42:01
That sounds simple, but it looks a bit more of a pain in the arse in practice...  Tongue Anyway, thanks for all the help, after I've changed my map system from an array of buffered images... I'll have a go at it, then post my results
26  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-24 18:59:23
Yeah, as much as I want things to work... I also want to learn HOW they work... so I know it's worth something Smiley
27  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-24 17:26:11
Fair enough, would the bit earlier about " if the gradient is greater than 1, do 1/gradient and step by y++ rather than x++." - would that work?
or are there better ways to do it?

EDIT: Also, why is it that your code doesn't work above gradients of 1?
28  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-24 14:38:33
Are there any good raycasting tutorials?
29  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-23 21:29:32
Wow, thats really helpful thanks!, with the everything posted here I should be able to take a good swing at getting this working. But I'm off to bed as I'm tired...
I'll make sure to post up progress later this week.  Smiley
30  Game Development / Game Mechanics / Re: [Help]2D tile map lighting on: 2012-04-23 21:17:44
Wouldn't using that library mean changing how I'm doing the mapping?
Pages: [1] 2
 

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 (46 views)
2014-10-17 03:59:02

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

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

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

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

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

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

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

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

BurntPizza (82 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!