Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (527)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (593)
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 / Game Mechanics / Re: Smooth Tile by tile movement on: 2014-06-15 02:38:19
Yes I see and I added the return thing. Im still having the first movement "choppy" effect though?
2  Games Center / Showcase / Re: DemonShooter ! First game release on: 2014-06-14 08:37:36
For some reason "Demon Shooter by Vinny" flickers? Is that a problem everyone gets? Is it your code?

The control scheme is a bit odd in my opinion for the right player. It just feels weird.

Btw you should make your own ships they would probably look better you don't even have to go into high detail just make them look retro-ish. The bullets are too small as well in my opinion. You could scale them up in Paint.NET or whatever you use or just make a simple bullet yourself. Both would work.

Other than that its a good start Smiley.
3  Games Center / Showcase / Re: Cirkit on: 2014-06-14 08:30:35
This game reminds me of the game we would play in our free time in Tech Ed in Middle School. Bloxorz or something. It was on cool math but I cant remember its name. Lol
4  Games Center / Showcase / Re: Flappy Taco | My first game on: 2014-06-14 08:27:09
Your pixel art is pretty good actually (Better than mine Tongue). Its really good for a first game and you should be happy with it. You should try to add on to it and make it different than the other generic flappy bird clones. You could extract the source but like Sickan it looks like regular Java. Which I like ^_^. Btw your title says "Flapy" it should be "Flappy" unless you like it that way.
5  Games Center / Archived Projects / Re: Draw on: 2014-06-14 08:20:29
Azn lol this reminds me of an Etch-A-Sketch. AppleSauce is right though. You should focus on something you really want to do. Small projects are good but they get boring after a while.
6  Game Development / Game Mechanics / Re: Smooth Tile by tile movement on: 2014-06-14 08:10:31
Ok this is like the weirdest thing. Now im having the same problem as I did at first but I fixed the other one. This is so awkward.

Heres by code:

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  
package net.gasquake.game.entities;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import net.gasquake.game.Zaffre;
import net.gasquake.game.entities.core.Entity;

public class Player extends Entity {
 
   private boolean lockedMovement = false, clickingArrows = false;
   private String direction = "null";
   
   public Player(int x, int y, Zaffre zaffre) {
      super(x, y, zaffre);
      w = 64; h = 64;
   }
 
     public void update() {
        if (x % 64 == 0 && y % 64 == 0) {
           if (!clickingArrows || dy > 0 && dx > 0) {
              dx = 0; dy = 0;
           }
           direction = "null";
           lockedMovement = false;
        }
        input();
        if (direction == "left") {
           dx = -4;
           dy = 0;
        }
      if (direction == "right") {
           dx = 4;
           dy = 0;
      }
      if (direction == "up") {
         dx = 0;
         dy = -4;
      }
      if (direction == "down") {
         dx = 0;
         dy = 4;
      }
      if (dx > 0) {
         dy = 0;
      }
      if (dy > 0) {
         dx = 0;
      }
        move(dx, dy);
     }
 
     public void render(Graphics g) {
        g.setColor(Color.white);
        g.fillRect(x, y, w, h);
     }
     
     public void input() {
        if (!lockedMovement) {
           if (zaffre.getKeyboard().keyDown(KeyEvent.VK_LEFT)) {
              lockedMovement = true;
              clickingArrows = true;
              direction = "left";
           }
         if (zaffre.getKeyboard().keyDown(KeyEvent.VK_RIGHT)) {
              lockedMovement = true;
              clickingArrows = true;
              direction = "right";
         }
         if (zaffre.getKeyboard().keyDown(KeyEvent.VK_UP)) {
            lockedMovement = true;
              clickingArrows = true;
              direction = "up";
         }
         if (zaffre.getKeyboard().keyDown(KeyEvent.VK_DOWN)) {
            lockedMovement = true;
              clickingArrows = true;
              direction = "down";
         }
        }
      if (zaffre.getKeyboard().keyUp(KeyEvent.VK_LEFT)) {
         clickingArrows = false;
        }
      if (zaffre.getKeyboard().keyUp(KeyEvent.VK_RIGHT)) {
           clickingArrows = false;
      }
      if (zaffre.getKeyboard().keyUp(KeyEvent.VK_UP)) {
         clickingArrows = false;
      }
      if (zaffre.getKeyboard().keyUp(KeyEvent.VK_DOWN)) {
         clickingArrows = false;
      }
     }
     
}


Does anyone see how im being dumb? lol
7  Game Development / Game Mechanics / Re: Smooth Tile by tile movement on: 2014-06-13 06:37:47
(When constantly moving across multiple tiles) When you go in any direction and then you stop moving midway it doesn't finish the tile. It just stops
8  Game Development / Game Mechanics / Re: Smooth Tile by tile movement on: 2014-06-13 06:25:49
Im not talking about the boundaries of the screen if thats what you mean. Im talking about the 32x32 "box" that the player moves along the grid. This is really weird. I've never done a movement system like this before.
9  Game Development / Game Mechanics / Re: Smooth Tile by tile movement on: 2014-06-13 06:16:55
I guess not lol. But now im having this problem where I can get out of the grid even though im locking the input... hmmm.
10  Game Development / Game Mechanics / Re: Smooth Tile by tile movement on: 2014-06-13 05:34:58
Oh ok lol.

Well I made a "clickingArrows" boolean and I set it to true if you were and false if you weren't. When you check when you are on a tile and you should set dx & dy to 0 you also check if they are clicking arrows. If they are don't set dx and dy to 0.

Hope that helped Smiley.
11  Game Development / Game Mechanics / Re: Smooth Tile by tile movement on: 2014-06-13 03:49:16
I FIXED IT. thanks liquid. Smiley
12  Game Development / Game Mechanics / Re: Smooth Tile by tile movement on: 2014-06-13 02:34:48
Wait do you mean a library? I would like to stay away from libraries if possible. If you mean a different method I can't seem to find one for some reason. Maybe its just me being dumb. I should probably look on Youtube. If you have any suggestions that would be great.
13  Game Development / Game Mechanics / Smooth Tile by tile movement on: 2014-06-13 01:29:26
Im having trouble with "smooth" tile by tile movement. I've got the basics down but on the very first one it stops after it reaches its point and continues on smoothly. I was wondering if thats because of the way I check if a key is pressed or if its the movement itself. Both the keyboard class and the player class are down below. I was hoping someone could help me with this issue. Thank you Smiley.

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  
package net.gasquake.game.input;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

public class Keyboard implements KeyListener {

   public int keyDown, keyUp;
   
   public boolean keyDown(int k) {
      if (k != this.keyDown) {
         return false;
       }
       this.keyDown = 0;
       return true;
   }
   
   public boolean keyUp(int k) {
      if (k != this.keyUp) {
         return false;
       }
       this.keyUp = 0;
       return true;
   }
   
   public void keyPressed(KeyEvent e) {
      this.keyDown = e.getKeyCode();
   }
     
   public void keyReleased(KeyEvent e) {
      this.keyUp = e.getKeyCode();
   }
     
   public void keyTyped(KeyEvent e) {}
   
}


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  
package net.gasquake.game.entities;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import net.gasquake.game.Zaffre;
import net.gasquake.game.entities.core.Entity;

public class Player extends Entity {

   private boolean lockedMovement = false;
   private int oldX, oldY;
   
   public Player(int x, int y, Zaffre zaffre) {
      super(x, y, zaffre);
      w = 64; h = 64;
   }
   
   public void update() {
      if (oldX == x || oldY == y) {
         if ((x % 64 == 0 && y % 64 == 0)) {
            lockedMovement = false;
            dx = 0; dy = 0;
         }
      }
      if (this.oldX != this.x) {
         this.oldX = this.x;
      }
      if (this.oldY != this.y) {
         this.oldY = this.y;
      }
      if (!lockedMovement) {
         if (zaffre.getKeyboard().keyDown(KeyEvent.VK_LEFT)) {
            dx = -4;
            lockedMovement = true;
         }
         if (zaffre.getKeyboard().keyDown(KeyEvent.VK_RIGHT)) {
            dx = 4;
            lockedMovement = true;
         }
         if (zaffre.getKeyboard().keyDown(KeyEvent.VK_UP)) {
            dy = -4;
            lockedMovement = true;
         }
         if (zaffre.getKeyboard().keyDown(KeyEvent.VK_DOWN)) {
            dy = 4;
            lockedMovement = true;
         }
         if (zaffre.getKeyboard().keyUp(KeyEvent.VK_LEFT)) {
            dx = 0;
         }
         if (zaffre.getKeyboard().keyUp(KeyEvent.VK_RIGHT)) {
            dx = 0;
         }
         if (zaffre.getKeyboard().keyUp(KeyEvent.VK_UP)) {
            dy = 0;
         }
         if (zaffre.getKeyboard().keyUp(KeyEvent.VK_DOWN)) {
            dy = 0;
         }
      }
      move(dx, dy);
   }
   
   public void render(Graphics g) {
      g.setColor(Color.white);
      g.fillRect(x, y, w, h);
   }

}


Can anyone tell me how to remedy this problem? Thanks btw I hope I made this thread correctly. Im new.
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.

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

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

toopeicgaming1999 (15 views)
2014-11-26 15:20:08

SHC (29 views)
2014-11-25 12:00:59

SHC (27 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (27 views)
2014-11-24 19:59:16

trollwarrior1 (40 views)
2014-11-22 12:13:56

xFryIx (78 views)
2014-11-13 12:34:49

digdugdiggy (57 views)
2014-11-12 21:11:50
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!