Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (653)
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: doubt about entity/Component system on: 2011-09-13 16:06:18
I think I understand it a bit better now, thanks a lot!!
2  Game Development / Newbie & Debugging Questions / Re: doubt about entity/Component system on: 2011-09-13 15:47:47
Thanks for replying so quickly Cheesy

So if I understand correctly, components are used both for the logic, like a graphicsComponent for drawing stuff and for keep data like the InfoComponent i said before, is this right?
3  Game Development / Newbie & Debugging Questions / doubt about entity/Component system on: 2011-09-13 15:36:32
Hi guys, I'm trying to implement a entity/component system to my game but there are things that I just don't get.

For example, where should all the data be, in the entity/GameObject/whatever-you-wanna-call-it class or in the component that uses it? With data I mean, for example the health of the player, the weapon it has equipped, the number of grenades it has, etc... Should i have a component like PlayerInfoComponent, or just InfoComponent that keeps that data?

Hope you can point me in the right direction
Thanks in advance
4  Game Development / Newbie & Debugging Questions / Re: problem with Slick2D animations on: 2011-09-09 10:07:57
It seems that for some strange reason, it refuses to add the images for the "boobingLeft" animation, and the index for every image is -1. The funny thing is that that animation is on the third row and should be ok, and even changing the x and y of the images to the first row for example still give me the same error. I tried changing the name of the animation, changing the coords, changing the order, since I'm doing it backwards, I even made a new 256x256 sheet with all the weapons animations and still nothing.

Trying to print out the index still gives me the same outOfBounds error.

update: Using a single spritesheet just for the boobingleft animation works fine, but it misses the point of using spritesheets at all, this is really pissing me off  Angry, also, adding this code to the end of the draw method
try {
         new SpriteSheet("sprites/WEAPONS_SHEET_256x256.png",32,32).getSprite(4,6).draw(150,279);
      } catch (SlickException e) {
         // TODO Auto-generated catch block
draws the correct image just fine.

Another Update: I think i got it, the problem its that i can't scan a spritesheet backwards because the first x argument is the 0 index in the arraylist of the animation, scanning to the left would be like going to the index -1.

Soooo yeah, it was that, i change the spritesheet and now works properly, Thanks ReBirth for the reply!!

5  Game Development / Newbie & Debugging Questions / problem with Slick2D animations [fixed] on: 2011-09-09 01:04:49
Hi guys, I'm a bit desperate here, hope you can help me or guide me in the right direction. The thing is that I'm trying to load the animations for the weapons of the main char (the game is a sidescroller metal-slug style), so, in the constructor i load all the animations on an arrayListHashMap, one for each weapon, i'll make a weapon class eventually but i wanted to try the code first, i have a 128x128 spritesheet for 4 animations, 4 32x32 frames each.

SpriteSheet escopetass =new SpriteSheet("sprites/SHOTGUN_SHEET_128x128.png",32,32);
         escopeta.put("still", new Animation(new SpriteSheet("sprites/SHOTGUN_STILL.png",32,32),1));
         escopeta.put("boobingLeft",new Animation(escopetass,3,2,0,2,true,250,true));
         escopeta.put("boobingRight",new Animation(escopetass,0,0,3,0,true,250,true));        
         escopeta.put("shootingRight",new Animation(escopetass,0,1,3,1,true,100,true));                  
         escopeta.put("Leftshooting",new Animation(escopetass,0,3,3,3,true,100,true));

I have the same block code for the other weapons as well,just changing the spritesheet, then in the draw method, i draw the animation depending the facing of the character, controlled with 2 booleans (facingLeft and facingRight)
when i try to run the game, i get an outOfBounds error on the animation class of slick2D.

}else if (facingLeft)
         if (arma.get("Leftshooting").isStopped())
         if (shooting){
         //its firing
            player.get("still"). getCurrentFrame().getFlippedCopy(true, false).draw(this.x,this.y);
         }else if (this.isMoving() && !shooting){
         //its moving            
            arma.get("boobingLeft").draw(this.x,this.y); //<----- Having problems in ths line

arma its an arrayListHashmap that contains the anims of the equipped weapon on that moment.

The error:
Fri Sep 09 02:57:19 CEST 2011 ERROR:-1
java.lang.ArrayIndexOutOfBoundsException: -1
   at java.util.ArrayList.get(Unknown Source)
   at org.newdawn.slick.Animation.getWidth(
   at org.newdawn.slick.Animation.draw(
   at com.PlayerEntity.draw(
   at com.Game.render(
   at org.newdawn.slick.GameContainer.updateAndRender(
   at org.newdawn.slick.AppGameContainer.gameLoop(
   at org.newdawn.slick.AppGameContainer.start(
   at com.Game.main(
Fri Sep 09 02:57:19 CEST 2011 ERROR:Game.render() failure - check the game code.
org.newdawn.slick.SlickException: Game.render() failure - check the game code.
   at org.newdawn.slick.GameContainer.updateAndRender(
   at org.newdawn.slick.AppGameContainer.gameLoop(
   at org.newdawn.slick.AppGameContainer.start(
   at com.Game.main(

Hope you can help me, its driving me nuts.
Thanks in advance  Smiley

(I'm not sure if this is the right place for the post, if it is not, move it to the right place please)
Pages: [1]
SHC (25 views)
2015-08-01 03:58:20

Jesse (19 views)
2015-07-29 04:35:27

Riven (40 views)
2015-07-27 16:38:00

Riven (21 views)
2015-07-27 15:35:20

Riven (24 views)
2015-07-27 12:26:13

Riven (14 views)
2015-07-27 12:23:39

BurntPizza (36 views)
2015-07-25 00:14:37

BurntPizza (46 views)
2015-07-24 22:06:39

BurntPizza (30 views)
2015-07-24 06:06:53

NoxInc (37 views)
2015-07-22 22:16:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

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 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‑
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!