Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (799)
Games in Android Showcase (237)
games submitted by our members
Games in WIP (865)
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
1  Game Development / Newbie & Debugging Questions / Re: Oval on: 2014-02-19 03:23:38
Oh. .I didn`t know the right keyword.

Thank you very much.
2  Game Development / Newbie & Debugging Questions / Oval on: 2014-02-19 03:16:28
Here I am again to ask question.

If there any way that I can assign a drawn Oval in a variable?

If in rectangle, you can do like this:

1  
Rectangle rect = new Rectangle(0, 0, 100, 50);


How about in Oval?

Is this the only way?

1  
2  
3  
4  
public void drawOval(Graphics2D g2d) {
        g2d.setColor(Color.RED);
        g2d.fillOval(x, y, DIAMETER, DIAMETER);
    }


I tried to search in Google but couldn`t find anything.

Thank for your help.
3  Games Center / Android Showcase / Re: Bat Potato on: 2014-02-18 14:52:32
Another version of flappy bird? >.<
4  Games Center / WIP games, tools & toy projects / Re: eXo - snappy space strategy on: 2014-02-18 14:47:33
I defeated the HARD one

LOL! I am so very happy!  Grin
5  Games Center / WIP games, tools & toy projects / Re: eXo - snappy space strategy on: 2014-02-18 07:49:40
wow!

I love it!

I can`t beat the hardest one Sad

I tried it once though
6  Game Development / Newbie & Debugging Questions / Re: How to simpe use sprit istead of fillRect on: 2014-02-17 02:26:29
Is there any difference with YAHOO and GOOGLE?

I always search using YAHOO.
7  Games Center / Android Showcase / Re: Superior Tactics - Tactical Space Battles RTS on: 2014-02-17 01:33:34
!"#$%&'()

Super Cool.

Speechless.
8  Games Center / 4K Game Competition - 2014 / Re: Nearing end... need couple of volunteers on: 2014-02-17 01:21:43
What are the qualifications of a judge?

I am a GAMER that is all I can say.
9  Game Development / Newbie & Debugging Questions / Re: How to simpe use sprit istead of fillRect on: 2014-02-15 14:36:36
Dude, I am also new here.

But I never asked this kind of question.
Before you ask try to ask GOOGLE or YAHOO first.

and for more, you can check this site: http://zetcode.com/tutorials/javagamestutorial/
you can learn different stuffs there.

Ask question if you really can`t understand the use of this or that.
Or better. try to code then show it here and what is the problem.

Thanks.

P.S. I am also newbie.
10  Game Development / Newbie & Debugging Questions / Re: How to intersect a oval and a rect ? on: 2014-02-15 14:29:36
It is easy.

Just use if-else condition.

Actually I made a game like this before while I am learning how to make a game through the help of tutorial.
http://zetcode.com/tutorials/javagamestutorial/

I want to tell the ball if what part of the block it hitted. If it is the top, bottom, left or right side, so that I can command the ball if where it will bounce.

for example:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
height = 10;
width = 50;
diameter = 20;

if (hitted) {
   if (oval.x + diameter == rectangle.x && oval.y + diameter < rectangle.y)
      left
   else if (oval.x == rectangle.x + width && oval.y + diameter < rectangle.y)
      right
}


With this you already know that the ball hitted the sides.
And you wanted it to be "game over";

Then you can write:

1  
2  
if (left || right)
   game over


It is easy, right?
But this is not a runnable code.
It is only an Algorithm.

I hope it will help you.
11  Discussions / General Discussions / Re: Java and Algebra. on: 2014-02-15 10:32:06
Is algebra the main problem here?

If you only know the basic math (MDAS), I think there will be no problem.

I think, the main problem is algorithm or logic.
If we can`t do this, I think it will be hard for us to program.
12  Game Development / Newbie & Debugging Questions / Re: Attack Delay on: 2014-02-15 08:18:15
Thank you very much for the explanation.
13  Game Development / Newbie & Debugging Questions / Re: Attack Delay on: 2014-02-15 06:52:49
Thank you for the quick response.

How long is the delay in seconds?

if may game`s timer = 50.
14  Game Development / Newbie & Debugging Questions / Attack Delay on: 2014-02-15 06:39:49
Hello guys,

I am making game but I just started and learning to make game.

Maybe I made the 5-10%  of it.

I want to know if how to code an "Attack Delay".

Did you get it?

I am planning to loop but I don`t know what to put.


I tried this:

1  
2  
3  
4  
5  
6  
7  
8  
time = 0;

while (time < 10) {
        if (time%2 == 0)
              attack;
        else
              rest;
}


but it is not working.

My game`s timer = 50.

If you know the game DOTA maybe you will get my point if the two creeps meet each other they will attack each other.

Thanks

15  Game Development / Newbie & Debugging Questions / Re: library games 2d on: 2014-02-15 05:55:18
I am not using anything yet but I am making game now.

I started making it last month.

I think you must learn and study on how Java works first.

16  Game Development / Newbie & Debugging Questions / Re: Is it easy to make games through pure java? on: 2014-02-14 09:19:01
I am only using JAVA

and now I am making my first game.

17  Game Development / Newbie & Debugging Questions / Re: [solved]getX() on: 2014-02-13 16:22:47
I already solved it. Thanks.
18  Game Development / Newbie & Debugging Questions / Re: getX() on: 2014-02-13 14:53:02
charR = new ImageIcon(Character.class.getResource("charR.jpg")).getImage();
 charL = new ImageIcon(Character.class.getResource("charL.jpg")).getImage();

why dont you just rotate the image in code , what lib/api are you using?
just asking =D Grin

what do you mean "rotate the image"?

I am using java netbeans.

All is working with keyPressed()

because if it doesnt my character will not move, right?
19  Game Development / Newbie & Debugging Questions / Re: getX() on: 2014-02-13 14:40:14
I already move it and tried it 3x

inside the move()
inside the public TowerAttack()
inside the Class TowerAttack()

Nothing changed.
20  Game Development / Newbie & Debugging Questions / Re: getX() on: 2014-02-13 14:30:48
Nope.

I will move my character L or R.

If my character will go inside the attack perimeter of the tower, it will attack my character.

This is the LOGIC of the tower`s attack
1  
2  
3  
if HIT
           x = starting_position_X;
           y = starting_position_Y;


where:
1  
2  
3  
HIT = false
         if attack.x == character.x
            HIT = true;

OR
1  
2  
3  
HIT = false
         if attack.getBounds().intersects.getBounds()
            HIT = true;


But my character`s X is always 250.
And I don`t know why.

P.S. This is not the real code. It is only the ALGORITHM or LOGIC.
21  Game Development / Newbie & Debugging Questions / Re: getX() on: 2014-02-13 14:08:19
I think there is no problem with the new Character() sir.
22  Game Development / Newbie & Debugging Questions / Re: getX() on: 2014-02-13 13:47:44
What is the problem with the new Character()?
23  Game Development / Newbie & Debugging Questions / Re: getX() on: 2014-02-13 13:43:38
Sorry for my poor explanations

This is my tower`s attack movement.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
 public void move() {
        character = new Character();      
       
        x -= dx;
        if (getY() <= character.getY() + character.getHeight()/2)
            y += dy;
        if (getX() == character.getX()) {
            System.out.println(character.getX());
            x = posX;
            y = posY;
        }
    }
24  Game Development / Newbie & Debugging Questions / Re: getX() on: 2014-02-13 13:00:07
I have this code for my tower`s attack

1  
2  
if (towerattack.x == character.x)
            System.out.print(character.x)


Then it returns the assigned variable or the starting position of the image when I will play it.

 x = 250;
25  Game Development / Newbie & Debugging Questions / [solved]getX() on: 2014-02-13 12:53:14
I doesn`t return the X-position of my character. What is the problem?

This is my 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  
96  
public class Character {

    private TowerAttack towerattack;

    private Image charR;
    private Image charL;

    private int x, y;
    private int width, height;
    private int dx;
    private int faceL, faceR;    

    private final int CHAR_SPEED = 5;

    public Character() {
        towerattack = new TowerAttack();

        getImages();
        height = 50;
        width = 20;

        faceL = 0;
        faceR = 0;        
       
        x = 250;
        y = 270;
    }

    public void drawChar(Graphics2D g2d) {
        if (faceL == 1)
            drawCharL(g2d);
        else
            drawCharR(g2d);
    }

    public void drawCharR(Graphics2D g2d) {
        g2d.drawImage(charR, getX(), getY(), null);
    }

     public void drawCharL(Graphics2D g2d) {
        g2d.drawImage(charL, getX(), getY(), null);
    }
   
    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public int getWidth() {
        return width;
    }

    public int getHeight() {
        return height;
    }

    public void getImages() {
        charR = new ImageIcon(Character.class.getResource("charR.jpg")).getImage();
        charL = new ImageIcon(Character.class.getResource("charL.jpg")).getImage();
    }

    public Rectangle getBounds() {
        return new Rectangle(x, y, width, height);
    }
   
    public void move() {
        x += dx;
    }

    public void keyPressed(KeyEvent e) {
        int key = e.getKeyCode();

        if (key == KeyEvent.VK_LEFT) {
            dx = -CHAR_SPEED;
            faceL = 1;
            faceR = 0;
        }
        if (key == KeyEvent.VK_RIGHT) {
            dx = CHAR_SPEED;
            faceR = 1;
            faceL = 0;
        }
    }

    public void keyReleased(KeyEvent e) {
        int key = e.getKeyCode();
       
        if (key == KeyEvent.VK_LEFT)
            dx = 0;
        if (key == KeyEvent.VK_RIGHT)
            dx = 0;
    }  
}


I hope you can help me.

I want to get the X-position of my character.

SOLUTION:
Put your attackMove() in your Panel.
26  Game Development / Newbie & Debugging Questions / Re: LWJGL, libGDX or what? on: 2014-02-08 11:58:47
Sorry for the expression "LOL", it became my habit in every message I put instead of using smiley  Smiley

I really do love programming.

But I stopped it doing since when I came here in Japan to study Jap. Language.

And now I want to do what I really love again.

I love to code.
I love LOGIC.

But I don`t have experience with Game Programming yet.

Now, I am working with it.

I want my game graphics to look better and I don`t what to do.

I really envy others because their graphics is super cool.
27  Game Development / Newbie & Debugging Questions / Re: LWJGL, libGDX or what? on: 2014-02-08 11:31:48
Maybe. LOL

Why did you think that I don`y like programming?
28  Game Development / Newbie & Debugging Questions / LWJGL, libGDX or what? on: 2014-02-08 10:50:02
I am not using any of these things yet.(what are these anyway? LOL)

If you will be my teacher, what will you recommend me?

So that, I can already start to study it.

Thanks.

(No Flame please, just suggestions)
29  Game Development / Newbie & Debugging Questions / Thread or Timer on: 2014-02-07 14:16:19
I watched and read many tutorials.

First, I learned about thread, then after awhile here comes Timer.

Which is which? and why?
30  Game Development / Newbie & Debugging Questions / Re: DOTA on: 2014-02-07 14:10:36
Thank you for the informations guys.

It helped me a lot.

 Smiley
Pages: [1] 2 3
 
Riven (201 views)
2019-09-04 15:33:17

hadezbladez (4909 views)
2018-11-16 13:46:03

hadezbladez (1810 views)
2018-11-16 13:41:33

hadezbladez (5183 views)
2018-11-16 13:35:35

hadezbladez (1024 views)
2018-11-16 13:32:03

EgonOlsen (4387 views)
2018-06-10 19:43:48

EgonOlsen (5228 views)
2018-06-10 19:43:44

EgonOlsen (2972 views)
2018-06-10 19:43:20

DesertCoockie (3875 views)
2018-05-13 18:23:11

nelsongames (4306 views)
2018-04-24 18:15:36
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45
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!