Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
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 ... 8
1  Discussions / Business and Project Management Discussions / Re: Looking for a team - Remove Tanks game on: 2018-03-17 16:07:47
I'd like to design levels if you want Cheesy
2  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Libgdx zoom and pan map on: 2018-03-05 13:51:06
okay, thanks! Bu why translate does not work ?
3  Game Development / Articles & tutorials / Flood fill algorithm to select a country in a map with libgdx on: 2018-03-03 14:05:37
See for working example and code here

Note: this solution is made for libgdx, using Pixmap

Building a 2d strategy game could be useful to draw a world map, divide countries using a specific color and then let user select a country, then highlight it. But how to made this selection without store any information about countries geometry ?

Solution: use flood fill algorithm!

<a href="http://www.youtube.com/v/zeer0N1cj_Y?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/zeer0N1cj_Y?version=3&amp;hl=en_US&amp;start=</a>

Solution is made with on the following steps:


1. get player click point as (x,y)
2. from (x,y) use flood fill algorithm to fill a specific area, delimited by border color
3. draw a border around the resulting image, not used areas are transparent
4. display image with border to the player

For the complete code, take a look here

4  Games Center / WIP games, tools & toy projects / Re: Drone Swarm on: 2018-03-03 08:48:20
Quote
What is the condition for capturing the enemy main base? When your first unit get there or when you kill all enemy units in the base?
I did'nt notice it because things are going very fast:)

Well said @meva, is when your units hit centre of enemy zone, I think there is a small bug here

@Gjallar: you are right, it's something I have to reconsider if I plan to work make another release, maybe a game where you can simply "set lines of attack" could be more interesting ?
5  Games Center / WIP games, tools & toy projects / Re: Katt - Run on The Tide on: 2018-03-03 08:45:38
really awesome graphics, well done! I notice something "wrong" on the camera system, because camera is linked to player position. You can improved on that using some methods, here some links:

http://soherearemyideas.blogspot.it/2012/06/my-view-on-2d-platformer-cameras.html
https://www.youtube.com/watch?v=TCIMPYM0AQg&feature=player_embedded

and when player jump on most higher platforms, should not be able to see the black behind the scene!
6  Java Game APIs & Engines / Engines, Libraries and Tools / Libgdx zoom and pan map on: 2018-03-02 22:22:20
This time I'm on a surprising problem and after some work I'm here to ask for help.  Huh

My point is to develop a "simple" way to have a decent zoom and pan functionality for a turn based game. In my mind requirement is to realize a zoom camera on top of a map, something like

<a href="http://www.youtube.com/v/s9tKaoap1bI?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/s9tKaoap1bI?version=3&amp;hl=en_US&amp;start=</a>

take a look to zoom in/out an pan.

Now, after some work I have to admit I don't have find a tutorial/documentation on how to organize my codebase to solve this problem, so the following points are my thoughts on this topic so far:

1) in my init code:
  - create a new OrthographicCamera: it's a 2d game, I don't need anything else
  - create a new Stage with some actors in (for example a window or a button)
  - use a InputMultiplexer and add two InputProcessor: one for stage (UI) and one for game entities: so I can separate input on ui and on game entities
2) in my render code every frame:
  - clear everything Cheesy
  - update camera
  - batch.begin
  - draw the baseMap
  - batch.end
  - stage.act: update ui
  - stage.draw: render ui
3) when zoom change, only camera zoom change, so ui is not scaled (this is good of course!)

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  
131  
132  
133  
134  
135  
136  
137  
138  
139  
package test;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.InputMultiplexer;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Dialog;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;

public class MapPanZoomExample extends ApplicationAdapter {

   private OrthographicCamera cam;
   private Image map;
   public SpriteBatch batch;
   private Stage stage;
   private Skin skin;

   @Override
   public void create() {
      batch = new SpriteBatch();
      // create ui
      stage = new Stage();
      skin = new Skin(Gdx.files.internal("defaultSkin/uiskin.json"));
      final Dialog dialog = new Dialog("Welcome", skin, "dialog") {
         public void result(Object obj) {
            System.out.println("Closed dialog!");
         }
      };
      dialog.setPosition(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2, 0);
      dialog.text("Hello World ! Try to move with mouse and zoom with mouse wheel");
      dialog.button("Close", true); // sends "true" as the result
      dialog.pack();
      dialog.setVisible(true);
      stage.addActor(dialog);
      // init camera
      cam = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
      cam.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
      // init map image
      map = new Image(new Texture("exampleMap.jpg"));
      // init input processor
      InputMultiplexer multi = new InputMultiplexer();
      multi.addProcessor(stage);
      multi.addProcessor(new InputProcessor() {

         @Override
         public boolean touchUp(int screenX, int screenY, int pointer, int button) {
            return false;
         }

         @Override
         public boolean touchDragged(int screenX, int screenY, int pointer) {
            return false;
         }

         @Override
         public boolean touchDown(int screenX, int screenY, int pointer, int button) {
            System.out.println("clicked: " + screenX + "," + screenY);
            return false;
         }

         @Override
         public boolean scrolled(int amount) {
            // arbitrary max zoomIn and max zoomOut values here
            if (cam.zoom - amount >= -0.25f && cam.zoom - amount <= 2) {
               cam.zoom -= (float) amount / 10f;
            }
            return true;
         }

         @Override
         public boolean mouseMoved(int screenX, int screenY) {
            return false;
         }

         @Override
         public boolean keyUp(int keycode) {
            return false;
         }

         @Override
         public boolean keyTyped(char character) {
            return false;
         }

         @Override
         public boolean keyDown(int keycode) {
            System.out.println("Key down: " + keycode);
            int step = 20;
            int dx = 0;
            int dy = 0;
            if (keycode == Keys.LEFT) {
               dx = -step;
            }
            if (keycode == Keys.RIGHT) {
               dx = step;
            }
            if (keycode == Keys.UP) {
               dy = step;
            }
            if (keycode == Keys.DOWN) {
               dy = -step;
            }
            cam.translate(dx, dy);
            return true;
         }
      });

      Gdx.input.setInputProcessor(multi);
   }

   @Override
   public void render() {
      Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
      cam.update();
      batch.setProjectionMatrix(cam.combined);
      batch.begin();
      map.draw(batch, 1);
      batch.end();
      stage.act(Gdx.graphics.getDeltaTime());
      stage.draw();
   }

   public static void main(String[] arg) {
      LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
      config.width = 1024;
      config.height = 768;
      new LwjglApplication(new MapPanZoomExample(), config);
   }

}


Questions:

1) zoom works fine, but how to translate/scale coordinates on screen when map is scaled ?
2) why If user try to move the map using keyboard, nothing moves ? see row 96 - 112
3) how to implement to move the map when mouse is "near" borders ?
4) order in render() method is fine ? see row 122

thanks in advance!
7  Games Center / WIP games, tools & toy projects / Re: Drone Swarm on: 2018-03-01 14:58:24
I've just released version 1.0 for Drone Swarm, in this release:

- 4 more levels, now 10 levels
- removed planet percentage indicator and added a coloured visual instead
- a little story screen

Any feedback as usual is appreciated!
8  Discussions / General Discussions / Re: Write Now, Run Anytime talk on: 2018-03-01 13:25:07
Nice project, I'm not a music creator but this kind of IDE could be useful to build quick demos/intro to some projects. Because this is Java gaming, do you plan to add some kind of support to gaming build in the future ?
9  Games Center / WIP games, tools & toy projects / Re: Drone Swarm on: 2018-02-21 07:54:11
@meva: nice idea, thanks!
10  Games Center / WIP games, tools & toy projects / Re: Drone Swarm on: 2018-02-04 13:37:53
I've just updated it to version 0.6:


- colored area around stations again
- levels with more than one AI to fight
- swapped level 2 and 3 (thanks to orochii)
- 3 more levels
- saved level progression on user home dir on disk

Not too much crazy, but another little step on right direction! Let me know if you find any bug or you have any suggestions, much appreciated!

You can play it on Itch.io: here
11  Games Center / WIP games, tools & toy projects / Re: Nine Levels (now with game-play video) on: 2018-02-04 10:14:17
I like trailer, well done and I agree on a shorter version, 45 seconds for me is enough
12  Games Center / WIP games, tools & toy projects / Re: Mortal Terminus on: 2018-01-20 14:21:48
Works fine, but I'm not sure what I have to do. I mean: npc are running around, someone with burgers, others shooting at me :-/
13  Discussions / General Discussions / Re: What's in a name? on: 2018-01-17 21:02:21
I'm not an admin, but hey, welcome back Cheesy

Curious to see how a programmer father can grow up some children with learning desire.. computing is almost everywhere right now!
14  Games Center / WIP games, tools & toy projects / Re: Nine Levels on: 2018-01-14 16:50:35
Sure, feel free do give us a demo too Tongue

You can find my games on my blog:

- Zombie employee
- Fuzzy
- Childhood toys
- Gravity duck tribute
15  Games Center / Android Showcase / Re: Blindfire - Alpha on: 2018-01-10 21:46:17
the concept is cool but a game that require 2 players? Really hard to find Sad
16  Games Center / WIP games, tools & toy projects / Re: Nine Levels on: 2018-01-10 21:43:39
Good work so far, I like it! I've made some platformers in the past and found really fun to do and to play Cheesy

Hope you will release soon as desktop/web too so I can try it Cheesy

Idea: add some mid/final bosses and some puzzles, my 2 requests Tongue
17  Games Center / Showcase / Re: Tile Remover - remove tiles by a falling tile on: 2017-12-31 10:32:59
well done, pretty basic, but no bugs.

For me after a little while (700 points ) it's a little boring because lack of chain reactions between tiles and in the end clearing last colors takes a lot of time

Also I really like for this kind of game to know next tile color, so as player I can plan my next moves

Note: I don't know if is random or not, but tiles color is not so random, every ten tiles there is always three tiles of the same color ( is a bug ? )
18  Games Center / WIP games, tools & toy projects / Re: Drone Swarm on: 2017-12-29 17:05:30
Version 0.5 is on itch.io and thanks to meva, I've fixed AI and added 3 levels, let me know what do you think about it !
19  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-12-07 08:34:08
Yesterday I've updated my prototype Drone Swarm to version 0.4, more info here

I've also put more effort on blog side and explained some thoughts on gameplay and focus on my blog

As usual is very hard to get some feedback on games in early (very early) development, so idea on how improve on that side is welcome
20  Games Center / Showcase / Re: Pirate Party on: 2017-12-06 21:31:59
I completely agree with VaTTeRGeR  about previous points!

Oh and holy shit, 228MB??? are you microsoft by any chance? Releasing a desktop version for this game with an embedded JVM and all that jazz is not necessary, nobody will play this mobile-game on a desktop, you might as well upload a *.jar with only the code and assets since the people here all have a JVM installed.

Yes, here, but many many times I've found that people doesn't simply have a Jre installed, so provide it is the only way. For example in my games ( small prototype, small game, btw!) this is not a big deal, but if you want to share to all people around is the only way I've found!
21  Games Center / WIP games, tools & toy projects / Re: Drone Swarm on: 2017-12-06 21:29:40
Insta-feedback! Thanks!

Now AI it's a little bit stronger and yeah circles around bases are gone for now, I'd like to find a better way to display them in the future!
22  Games Center / WIP games, tools & toy projects / Re: Drone Swarm on: 2017-12-06 21:10:13
Version 0.4 on itch.io !

This time I've shared more toughts on this release and future work, so feel free to try the game and feedback!

@VaTTeRGeR: what do you think about new selection mode?

In this release:
- new selection mode: drag selection boxes
- added a proper menu and level selection screen
- improved basic AI
23  Games Center / WIP games, tools & toy projects / Re: Drone Swarm on: 2017-12-05 13:43:34
thanks @VaTTeRGeR for your feedback!

I agree selection could be more intuitive, I hope to create something like an RTS (Starcraft, Warcraft) following your advice, really appreciated!

I miss the stop moving bug, thanks for noticing it
24  Games Center / WIP games, tools & toy projects / Re: Drone Swarm on: 2017-12-04 21:58:04
Version 0.3 is up on itch.io !

In this version:

- player can more easily select drones drawing selection boxes
- simple AI that attack player stations and drones!
25  Games Center / WIP games, tools & toy projects / Re: Advent Game Calendar on: 2017-12-01 09:55:13
I love today's puzzle game, but 78 levels are too much, sorry Sad made 30 levels and become a little bit repetitive
26  Discussions / General Discussions / Re: Motivation of Fresh Game - Big Issue on: 2017-11-24 15:17:00
My process:

- don't stress yourself, play a lot, don't read, play!
- write down your ideas, just 2 row, write down 50 ideas
- pick 5 of them, build a mindmap with all details you are able to do, research competitors and so on
- pick 2 ideas, build a little demo, let others play it, get feedback
- pick best one and build it

Find your unique way!  Do you like platformer like super mario bros? Why? How to change some little elements and be unique ? Ideas are cheap, execution matters. Do you want to build a new chess? do it! Change some rules, check if could be fun

In my experience is more important to try it, do it, and find your unique way. Don't copy or search of other's ideas, find your ideas, something that you care, because develop a game is hard! Cheesy

my 2 cents

27  Games Center / WIP games, tools & toy projects / Re: BabyGraph on: 2017-11-22 09:51:29
Nice job, btw on my nexus 5x entering the formula is a little bit slow
28  Game Development / Newbie & Debugging Questions / Re: Candy Breaking produce flickering candies. on: 2017-11-21 21:10:31
My suggestion is to put your code in a minimal example, so other people can understand it and maybe help you, only fragments of code .. is really hard to understand correctly your problem
29  Discussions / General Discussions / Re: Any Tips/Advice for a Newbie trying to make something big with LibGDX? on: 2017-11-21 20:22:16
I agree, start with Pong, make some kind of platform, don't start too big, try to end a project before start new one!
30  Games Center / WIP games, tools & toy projects / Re: Remove Tanks on: 2017-11-19 21:00:45
nice game, thanks for the demo! My score in the end on first run was 755 points, not too bad Tongue
Pages: [1] 2 3 ... 8
 
ivj94 (583 views)
2018-03-24 14:47:39

ivj94 (47 views)
2018-03-24 14:46:31

ivj94 (374 views)
2018-03-24 14:43:53

Solater (61 views)
2018-03-17 05:04:08

nelsongames (108 views)
2018-03-05 17:56:34

Gornova (150 views)
2018-03-02 22:15:33

buddyBro (693 views)
2018-02-28 16:59:18

buddyBro (91 views)
2018-02-28 16:45:17

xxMrPHDxx (493 views)
2017-12-31 17:17:51

xxMrPHDxx (731 views)
2017-12-31 17:15:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
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!