Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
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  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibGDX - How to create a rain and cloud? (Using "Particle") on: 2014-01-02 14:07:21
The video below is version 2.0 of my project, jumps to the 01:00 time +, there has the following effects:
1. Cloud moving horizontally.
2. Sandstorm.
3. Rain.

Item 1 and 2 I made a giant image that moves vertically to a point and restarts again.
Note: Would have any idea or better and performative suggestion for items 1 and 2?

Item 3 I draw several rectangles and let falling (Alternate only the expessura of it)
<a href="http://www.youtube.com/v/2vc7KPJJZ00?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/2vc7KPJJZ00?version=3&amp;hl=en_US&amp;start=</a>
Do you know a website with pre particles ready? (You may also pay site).
2  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibGDX - How to create a rain and cloud? (Using "Particle") on: 2014-01-02 05:55:00
I had seen this link, but did not quite understand his explanation.

As I understand it creates 10 images on the screen and stretches them vertically. Then back to normal size and keep doing that for a while, my understanding is correct? or it just toggles between visible (true and false), creating an optical illusion (Giving the idea that they are falling)?

Any link or picture with something similar to that to think about the effect of cloud and Sandstorm?
3  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibGDX - How to create a rain and cloud? (Using "Particle") on: 2014-01-02 05:21:40
Good, let's start.

I was going to rain as follows:
Various actors in a "Stage" falling vertically, being drawn randomly on the screen. (But it has a higher cost in processing and memory)

I made a simple example with particle (to whom I sent screen and full class code in the 1st post), and I realized that maybe used for particle effects:
rain
Cloud passing horizontally
mist
Sandstorm
thunder

Particles would be more interesting with, so I decided to just ask about the rain and it aparti have mold to see how would the other effects.
4  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibGDX - How to create a rain and cloud? (Using "Particle") on: 2014-01-02 05:09:00
The question was straightforward and simple!
And there's also simple and direct answer.

But as I'm redoing the project in LibGDX, like intelligent and straightforward opinions on the subject.
If possible show with code or ready examples would be wonderful! (And I particularly like other would be grateful).

My project, and free and open-source (source-forge), then all progress on the project and directly passed on to the community.

There are several ways to do this until I talked to the guys here a long time ago.
See Link:
http://www.java-gaming.org/topics/slick2d-how-to-create-a-rain-and-snow/26424/msg/231818/view.html#msg231818


5  Java Game APIs & Engines / Engines, Libraries and Tools / Re: LibGDX - How to create a rain and cloud? (Using "Particle") on: 2014-01-02 04:54:45
How to create the effect of rain?
How to create the effect of cloud across the map?
Note: If using Particle possible!
6  Java Game APIs & Engines / Engines, Libraries and Tools / LibGDX - How to create a rain and cloud? (Using "Particle") on: 2014-01-02 04:48:39
How to create the effect of rain?
How to create the effect of cloud across the map?
Note: If using Particle possible!

Below is the full code that generates these particles on the screen.
Did you do the rainfall and cloud moving horizontally alert Particle if possible.

Otherwise what would be another outlet for this problem?



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  
package project.parallax;

import project.parallax.actor.Hero;
import box2dLight.PointLight;
import box2dLight.RayHandler;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.ParticleEffect;
import com.badlogic.gdx.graphics.g2d.ParticleEmitter;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;
import com.badlogic.gdx.utils.Array;

public class LightRenderer {
  private RayHandler rayHandler;
  private OrthographicCamera camera;
  private PointLight playerLight;
  private Hero player;
  private ParticleEffect effect;
  private Vector2 positionLight = new Vector2();
  private BodyDef tileBodyDef;
  private World lightWorld;
  private FixtureDef fixtureDef;
  private PolygonShape tileShape;


  public LightRenderer(OrthographicCamera camera, Hero player) {
    this.camera = camera;
    this.player = player;

    lightWorld = new com.badlogic.gdx.physics.box2d.World(new Vector2(), true);

    RayHandler.useDiffuseLight(true);
    this.rayHandler = new RayHandler(lightWorld);
    this.rayHandler.setCombinedMatrix(this.camera.combined);
   
    int distanceLight = 96;
    playerLight = new PointLight(rayHandler, 128, new Color(0.8f,0.8f,0.8f,0.6f), distanceLight, 510, 385);
   
    // Create a shape that casts a shadow
    PolygonShape tileShape = new PolygonShape();
    tileShape.setAsBox(5.5f, 5.5f);

    tileBodyDef = new BodyDef();
    tileBodyDef.type = BodyType.StaticBody;

    fixtureDef = new FixtureDef();
    fixtureDef.shape = tileShape;
    fixtureDef.filter.groupIndex = 0;

    tileBodyDef.position.set(510, 385);
    effect = new ParticleEffect();
    effect.load(Gdx.files.internal("data/test.p"),Gdx.files.internal("data/"));
    Array<ParticleEmitter> emitters = new Array<ParticleEmitter>(effect.getEmitters());
    effect.getEmitters().clear();
    effect.getEmitters().add(emitters.get(3));    
    effect.start();
    //tileShape.dispose();
  }
 
  SpriteBatch sb = new SpriteBatch();
  public void drawBlasts(){
     
     effect.setPosition(300, 300);
     sb.begin();
     effect.draw(sb, Gdx.app.getGraphics().getDeltaTime());
     sb.end();
   }  
 
  /**
   * Cria uma so~mbra,como se estivesse segurando uma vela.
   */

  public void addEffectShadow(){
    Body tileBody = lightWorld.createBody(tileBodyDef);
    tileBody.createFixture(fixtureDef);
  }

  public void setAmbient(Color color) {
    this.rayHandler.setAmbientLight(color);
  }

  public void render() {
   this.positionLight.set(this.player.getX(), this.player.getY());
    this.playerLight.setPosition(positionLight);
    this.rayHandler.setCombinedMatrix(this.camera.combined);
    this.rayHandler.updateAndRender();
  }

  public void dispose() {
    rayHandler.dispose();
    tileShape.dispose();
  }

   public PointLight getPlayerLight() {
      return playerLight;
   }
   
   public void setPlayerLight(PointLight playerLight) {
      this.playerLight = playerLight;
   }
   
}


Test.p
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  
140  
141  
smoke
- Delay -
active: false
- Duration -
lowMin: 1.0
lowMax: 1.0
- Count -
min: 0
max: 1000
- Emission -
lowMin: 0.0
lowMax: 0.0
highMin: 3.0
highMax: 3.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Life -
lowMin: 0.0
lowMax: 0.0
highMin: 3000.0
highMax: 3000.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Life Offset -
active: false
- X Offset -
active: false
- Y Offset -
active: false
- Spawn Shape -
shape: square
- Spawn Width -
lowMin: 0.0
lowMax: 0.0
highMin: 180.0
highMax: 800.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Spawn Height -
lowMin: 0.0
lowMax: 0.0
highMin: 110.0
highMax: 6000.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Scale -
lowMin: 0.0
lowMax: 0.0
highMin: 256.0
highMax: 256.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Velocity -
active: true
lowMin: -25.0
lowMax: -25.0
highMin: 25.0
highMax: 25.0
relative: false
scalingCount: 2
scaling0: 0.0
scaling1: 1.0
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Angle -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 1.0
highMax: 360.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Rotation -
active: true
lowMin: 1.0
lowMax: 360.0
highMin: -30.0
highMax: 30.0
relative: true
scalingCount: 2
scaling0: 0.0
scaling1: 1.0
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Wind -
active: false
- Gravity -
active: false
- Tint -
colorsCount: 6
colors0: 1.0
colors1: 0.0
colors2: 0.0
colors3: 1.0
colors4: 0.9843137
colors5: 0.0
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Transparency -
lowMin: 0.0
lowMax: 0.0
highMin: 1.0
highMax: 1.0
relative: false
scalingCount: 3
scaling0: 0.0
scaling1: 0.49122807
scaling2: 0.0
timelineCount: 3
timeline0: 0.0
timeline1: 0.5068493
timeline2: 1.0
- Options -
attached: false
continuous: true
aligned: false
additive: true
behind: false
- Image Path -
particle-cloud.png


effect rain:
Click to Play
7  Java Game APIs & Engines / Engines, Libraries and Tools / LibGdx - ScrollPane Move to the last inserted (Label)? on: 2013-12-28 01:20:51
Same Problem:
Label wrap and Scrolling the ScrollPane (http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=11089&p=49905&hilit=ScrollPane#p49905)

How do I move to the last inserted Label?

I try this.scrollTo(0, 0, 0, 0);, no work corretly, See the figure below:
Note: I try too setScrollX and setScrollY but it doesn't work.


MySource:
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  
public class LogScrollPane extends ScrollPane {
   
   private static Table log = new Table();
   private final int MAX_SIZE   =   10;
   
   public LogScrollPane(Skin skin) {
      super(log, skin);
      //clear();
      this.setScrollingDisabled(false, false);
      //this.setForceScroll(false, true);
      log.align(Align.left);
   }
   
   public void add(Label label) {
     log.add(label);
      log.row();
     updateList();      
      this.scrollTo(0, 0, 0, 0);
      this.invalidate();
   }
   
   public void updateList(){
      int count = log.getChildren().size;
      int result = count-MAX_SIZE;
      if (result>0){
         for (int a=0;a<result;a++){
            log.removeActor(log.getChildren().get(a));
         }        
      }
   }
   
   public void clear() {
      log.clear();
      this.invalidate();
   }
}


Found that when the method is executed below (updateList ()), it does what it should, displaying the last added.
Note Remember that it ta displaying the penultimate added.

1  
2  
3  
4  
5  
6  
7  
8  
9  
    public void updateList () {
       int count = log.getChildren () size.;
       int result = count-MAX_SIZE;
       if (result> 0) {
          for (int a = 0, the <result, the + +) {
             log.removeActor (log.getChildren () get (a).);
          }
       }
    }
8  Game Development / Shared Code / [LibGDX] Where can I find "Themed Skin" for "scene2d.ui"? on: 2013-04-20 14:31:22
Where can I find "Themed Skin" for "scene2d.ui"?

I'm no designer, I am a developer, and would like to find themes ready to work with the "scene2d.ui".
Example: http://www.badlogicgames.com/forum/viewtopic.php?f=22&t=8533&p=39532#p39532

Wanted to do something with the medieval theme, but do not know how to do.
9  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Slick2D - How to create a rain and snow? on: 2012-05-11 14:40:22
People really appreciate the help, I know that patience is complicated, but breaking that branch, ta almost ready. Smiley
10  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Slick2D - How to create a rain and snow? on: 2012-05-11 12:30:20
Get it to work thanks, I really did not understand (What's doing things early in the morning), I rested a little and got the project again and it worked (of course adapted to my reality.) My only question is how do I get the rain on the diagonal?

For example when I put "graphics.rotate (0, 0, 30.0f)," it does not come out of the screen, but starts from the inside, almost in the middle of the screen.

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  
    private Timer spawnRain;
    private ArrayList<RainDrops> rain;

   public void initialize() {
      spawnRain = new Timer(200);
      rain = new ArrayList<RainDrops>();
      spawnRain(5,10);
   }

    /**
    * <b> This method shall be called the update method, passing the delta
    * As parameter. </ B> <p>
    *
    * It performs two tasks: <br>
    * 1. Updates the timer when the timer is complete it recreates new objects (raindrops) by calling the {@ link # spawnRain (int, int) spawnRain (int, int)}. <br>
    * 2. Keep moving objects (Moving X pixes per second).
    *
    * @ Param delta
    */

    public void updateRain(int delta){
       //Checa se pode fazer o spawn das gostas de chuva
       spawnRain.update(delta);
      if (spawnRain.isTimeComplete() == true) {
         //Cria de 5 a 10 gotas de chuva e depois reseta o timer
         spawnRain(5,10);
         spawnRain.resetTime();
      }
     
      //Move 96 pixel in 1 seg
      float speed = Util.getInstance().calcSpeed(delta, 1000f, 96f);
       
      //RainDrops que serão removidos
      ArrayList<RainDrops> rainRemove = new ArrayList<RainDrops>();
     
      //Atualiza a posição das entidade "chuva" movendo elas para baixo
       for (RainDrops rainDrops : rain){
           rainDrops.addY(speed);
           
           //Se chegar ao fim da tela marca para remoção
           if ( rainDrops.getY() > (Util.getInstance().getCameraOffsetXY().y + FacadeFactory.getConfiguration().get(1, false).getGameFrameHeight())){
              rainRemove.add(rainDrops);
           }
       }
       
       //Remove efetivamente as gotas de chuva que chegaram ao fim da tela
       //Efetivamente parando de desenhar e atualizar seus movimentos (Pondo os RainDrops para o coletor de lixo)
       rain.removeAll(rainRemove);
    }

    /**
    * Draw the rain effectively
    */

   private void renderRain(){
      graphics.rotate(0, 0, 0f);
      for (RainDrops rainDrops : rain) {
         graphics.fillRect(rainDrops.getX(), rainDrops.getY(), 1, 2);  
      }
      graphics.rotate(0, 0, -0f);
   }

    /**
    * This method creates the near objects (raindrops) that will be created. <P>
    */

    private void spawnRain(int min, int max){
       RainDrops rainDrops = null;
       int value = Util.getInstance().randomIntervalValue(min,max);
       for (int x=0; x<value;x++){
          rainDrops = new RainDrops();
       rainDrops.setX(Util.getInstance().getCameraOffsetXY().x + (int) (Math.random() * FacadeFactory.getConfiguration().get(1, false).getGameFrameWidth()));
       rainDrops.setY((float) Util.getInstance().getCameraOffsetXY().y);
       rain.add(rainDrops);
       }
    }
11  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Slick2D - How to create a rain and snow? on: 2012-05-11 01:02:24
I'll redo the problem and will post here after you're done.
12  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Slick2D - How to create a rain and snow? on: 2012-05-11 00:42:24
I tried to adapt your code, but it did not work has something in his logic that is not right.

As you said is a pseudo code, I tried to adapt, but what happened was that flash images on the screen images and not falling as it should be.
13  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Slick2D - How to create a rain and snow? on: 2012-05-10 20:24:59
Not working, I tested the codes above and nothing, even managed to appear fixed rectangles that were flashing on the screen, but nothing more.
14  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Slick2D - How to create a rain and snow? on: 2012-05-10 08:41:46
I tried to make the example, using what you have spoken in the 2nd post, but not ta Dand right, that entity can not be a simple rectangle with a white background?

This is looking pretty complex Undecided

my class responsible for drawing everything that is above the User (eg. fog, sandstorm, etc.).
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  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170  
171  
172  
173  
174  
175  
176  
177  
178  
179  
180  
181  
182  
183  
184  
185  
186  
187  
188  
189  
190  
191  
192  
193  
194  
195  
196  
197  
198  
199  
200  
201  
public class RenderMapCloudSystem extends EntityProcessingSystem implements ManagerAllSystem{
   
   private GameContainer container;
   
   private Graphics graphics;
   private CameraCharacterSystem cameraSystem;

   private int value;
   private Timer turnForMapEffect;
   
   private Timer turn;  
   private int currentTurn;
   private Image imgNight;
   
   @SuppressWarnings("unused")
   private boolean day;
   
   private Image img;
   private int directionStartEffect;
   
   @SuppressWarnings("unchecked")
   public RenderMapCloudSystem(GameContainer container) {
      super(CharacterComponent.class);
      this.container = container;
      this.graphics = container.getGraphics();
   }

   @Override
   public void initialize() {
      cameraSystem = world.getSystemManager().getSystem(CameraCharacterSystem.class);
      turnForMapEffect = new Timer(1000); //1000ms=1.0seg
      turn = new Timer(1000); //1000ms=1.0seg | //600000ms=10 minutos
      img =  null;
      imgNight =  ResourceManager.getFog("Night");
      imgNight.setAlpha(0.0f);
      day = true;
      currentTurn = 0;
      restartSystem();
   }
   
   @Override
   public void restartSystem() {
      value=0;
      String effectMap = ManagerMap.getInstance().getCurrentMap().getEffectMap();
      if (effectMap==null || effectMap.isEmpty()){
         img =null;
      } else  if (effectMap.equals("sandStorm")){
         img =  ResourceManager.getFog("Sandstorm02");
         img.setAlpha(0.7f);
         turnForMapEffect.resetTime(50, 50); //1000ms=1.0seg
         directionStartEffect = EnumPosition.FACE_DOWN.getIndex();
      } else if (effectMap.equals("mist")){
         img =  ResourceManager.getFog("Fog01");
         img.setAlpha(0.4f);
         turnForMapEffect.resetTime(50, 50); //1000ms=1.0seg
         directionStartEffect = EnumPosition.FACE_RIGHT.getIndex();
      } else if (effectMap.equals("cloud")){
         img =  ResourceManager.getFog("Clouds01");
         img.setAlpha(0.2f);
         turnForMapEffect.resetTime(50, 50); //1000ms=1.0seg
         directionStartEffect = EnumPosition.FACE_LEFT.getIndex();
      }  
   }
   
   @Override
   protected void process(Entity player) {
     
      cameraSystem = world.getSystemManager().getSystem(CameraCharacterSystem.class);

      int cameraOffSetPixelX = (int) -cameraSystem.getOffsetX();
      int cameraOffSetPixelY = (int) -cameraSystem.getOffsetY();
      cameraOffSetPixelX = cameraOffSetPixelX - cameraOffSetPixelX
            % Util.getInstance().getTileSize();
      cameraOffSetPixelY = cameraOffSetPixelY - cameraOffSetPixelY
            % Util.getInstance().getTileSize();

      int cameraOffSetTileX = (cameraOffSetPixelX) / Util.getInstance().getTileSize();
      int cameraOffSetTileY = (cameraOffSetPixelY) / Util.getInstance().getTileSize();
      int visionX = ((this.container.getWidth() / Util.getInstance().getTileSize()) + 2)-9;
      int visionY = ((this.container.getHeight() / Util.getInstance().getTileSize()) + 2)-6;

      ManagerMap.getInstance().getTmap().render(cameraOffSetPixelX,
            cameraOffSetPixelY, cameraOffSetTileX, cameraOffSetTileY,
            visionX, visionY, EnumTiledLayer.HEAD_UP.getIndex(), true);
      ManagerMap.getInstance().getTmap().render(cameraOffSetPixelX,
            cameraOffSetPixelY, cameraOffSetTileX, cameraOffSetTileY,
            visionX, visionY, EnumTiledLayer.HEAD_UP_2.getIndex(), true);
      ManagerMap.getInstance().getTmap().render(cameraOffSetPixelX,
            cameraOffSetPixelY, cameraOffSetTileX, cameraOffSetTileY,
            visionX, visionY, EnumTiledLayer.SKY.getIndex(), true);
     
      ManagerMap.getInstance().getTmap().render(cameraOffSetPixelX,
            cameraOffSetPixelY, cameraOffSetTileX, cameraOffSetTileY,
            visionX, visionY, EnumTiledLayer.SKY_2.getIndex(), true);
     
      if (img !=null){
         if (directionStartEffect == EnumPosition.FACE_LEFT.getIndex()) {
            img.draw(0-value, 0, 2000, 2000);
         } else if (directionStartEffect == EnumPosition.FACE_RIGHT.getIndex()) {
            img.draw((0-FacadeFactory.getConfiguration().get(1, false).getGameFrameWidth())+value, 0, 2000, 2000);
         } else if (directionStartEffect == EnumPosition.FACE_DOWN.getIndex()) {
            img.draw(0, (0-FacadeFactory.getConfiguration().get(1, false).getGameFrameHeight())+value, 2000, 2000);
         } else if (directionStartEffect == EnumPosition.FACE_UP.getIndex()) {
            img.draw(0, (0-value), 2000, 2000);
         }
      }
     
         if (ManagerMap.getInstance().getCurrentMap().isEnableDayNight()==true){
            imgNight.draw(0,0,ManagerMap.getInstance().getCurrentMap().getMapWidthInPixel(), ManagerMap.getInstance().getCurrentMap().getMapHeightInPixel());
         }

   }
   
   public void checkTurnDayNight(){
     
      //Controla o dia e noite
      turn.update(this.world.getDelta());
      if (turn.isTimeComplete() == true) {
         currentTurn++;
            if (currentTurn == 1){ //0 minuto
               imgNight.setAlpha(0.0f);
               day = true;
            } else if (currentTurn == 600){ //10minutos
               imgNight.setAlpha(0.1f);
               day = true;
            } else if (currentTurn == 1200){ //20 minutos
               imgNight.setAlpha(0.2f);
               day = true;
            } else if (currentTurn == 1800){ //30 minutos
               imgNight.setAlpha(0.3f);
               day = true;
            } else if (currentTurn == 2400){ //40 minutos
               imgNight.setAlpha(0.4f);
               day = false;
            } else if (currentTurn == 3000){ //50 minutos
               imgNight.setAlpha(0.5f);
               day = false;
            }  else if (currentTurn == 3600){ //60 minutos
               imgNight.setAlpha(0.6f);
               day = false;
            } else if (currentTurn == 4200){ //80 minutos
               imgNight.setAlpha(0.5f);
               day = false;
            } else if (currentTurn == 4800){ //90 minutos
               imgNight.setAlpha(0.4f);
               day = false;
            } else if (currentTurn == 5400){ //100 minutos
               imgNight.setAlpha(0.3f);
               day = true;
            } else if (currentTurn == 6000){ //110 minutos
               imgNight.setAlpha(0.2f);
               day = true;
            } else if (currentTurn == 6600){ //120 minutos
               imgNight.setAlpha(0.1f);
            }  else if (currentTurn == 7200){ //130 minutos
               currentTurn=0;
            }

         turn.resetTime();
      }
     
     

   }
   
   public void mapEffect(){
      //Controla o clima do mapa
      turnForMapEffect.update(this.world.getDelta());
      if (turnForMapEffect.isTimeComplete() == true) {
         value++;
         if (img !=null){
            if (directionStartEffect == EnumPosition.FACE_RIGHT.getIndex() ||
                  directionStartEffect == EnumPosition.FACE_LEFT.getIndex()) {
               if (value == (FacadeFactory.getConfiguration().get(1, false).getGameFrameWidth()-50)){
                  value=0;
               }
            } else if (directionStartEffect == EnumPosition.FACE_UP.getIndex() ||
                  directionStartEffect == EnumPosition.FACE_DOWN.getIndex()){
               if (value == (FacadeFactory.getConfiguration().get(1, false).getGameFrameHeight()-50)){
                  value=0;
               }
            }
         }
         turnForMapEffect.resetTime();
      }      
   }
   
   @Override
   protected void begin() {
      graphics.translate(cameraSystem.getOffsetX(), cameraSystem.getOffsetY());
      super.begin();
   }

   @Override
   protected void end() {
      graphics.translate(-cameraSystem.getOffsetX(),
            -cameraSystem.getOffsetY());
      super.end();
   }

}


R.D.
how to have a main method just to make this effect of rain?
15  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Slick2D - How to create a rain and snow? on: 2012-05-10 05:48:53
I understand about the thunder, but I found the example of rain where you spoke.
16  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Slick2D - How to create a rain and snow? on: 2012-05-10 05:35:21
For rain, one example would be the main method, this type here?

http://blog.gemserk.com/2011/03/19/lighting-bolts-effect/

I am remembering that crude about it, so please kindly give me an example with a main method that I poss test and leave evolving.

Do not even know where or how to create particle rain to get an idea.
17  Java Game APIs & Engines / Engines, Libraries and Tools / Slick2D - How to create a rain and snow? on: 2012-05-10 04:51:47
As I understand it is to do this using particle, but does Osei how to do it, someone could put a simple example with rain (and thunder).
Extra info: my screen is 800x600, the camera goes with the character.

Thanks for any 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.

rwatson462 (28 views)
2014-12-15 09:26:44

Mr.CodeIt (19 views)
2014-12-14 19:50:38

BurntPizza (35 views)
2014-12-09 22:41:13

BurntPizza (70 views)
2014-12-08 04:46:31

JscottyBieshaar (32 views)
2014-12-05 12:39:02

SHC (44 views)
2014-12-03 16:27:13

CopyableCougar4 (40 views)
2014-11-29 21:32:03

toopeicgaming1999 (108 views)
2014-11-26 15:22:04

toopeicgaming1999 (94 views)
2014-11-26 15:20:36

toopeicgaming1999 (29 views)
2014-11-26 15:20:08
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!