Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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: How to get the tiles around a player for collision detection? on: 2013-12-12 16:19:57
This is the code I use for collision detection.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
public boolean bump(Obj obj) {
   for(int x = 0, y = 0; y <= obj.height;) {
      if(this.getX() + x >= obj.getX() && this.getX() <= obj.getX()-1 + obj.getWidth() && this.getY()-1 + y >= obj.getY() && this.getY() <= obj.getY()-1 + obj.getHeight()) {
         return true;
      }
     
      x++;
      if(x >= obj.width) {
         y++;
         x = 0;
      }
   }
   
   return false;
}


And this is the move 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  
public void move(double xS, double yS, GamePanel panel) {
   this.x += Math.round(xS);

   for(Map mp : panel.mapList) {
      if(mp.name.equals(panel.actualMap)) {
         for(Obj obj : mp.objList) {
            if(this.bump(obj) && obj != this) {
               this.x -= Math.round(xS);
               
               this.xSpeed = 0;
               
               break;
            }
         }
      }
   }
   
   this.y += Math.round(yS);
   
   for(Map mp : panel.mapList) {
      if(mp.name.equals(panel.actualMap)) {
         for(Obj obj : mp.objList) {
            if(this.bump(obj) && obj != this) {
               this.y -= Math.round(yS);
               
               this.ySpeed = 0;
               
               return;
            }
         }
      }
   }
}


As you can see in the second code, I add the xSpeed/ySpeed to the obj's x/y, and then I check if it bumps any obj, if it does, I subtract the xSpeed/ySpeed from the obj's x/y, if it doesn't bump anything, the method terminates.

I don't think this is a good idea for collision detection, but I don't know other way, so, I hope it helped you.
2  Discussions / General Discussions / Re: In Need of Studying Tips on: 2013-12-11 16:23:10
Don't go numerically through chapters, start from the stuff you remember the most.
Good tip.

I study java ebooks(on my mobile phone or computer) 1 hour everyday, I practice what I learned and this is it.
At school... I hate portuguese(I'm brazillian), but I'm good with english(maybe because I play games everyday? LOL).

And tip I could give to you... Write many questions based on what you studied, answer them, read sometimes the answer, then ask the questions to yourself, that's what I do to study =]
3  Games Center / WIP games, tools & toy projects / Re: CastleDefense on: 2013-12-11 11:08:15
I liked the game.
But... Something kind of annoys me... There are materials near and the minions go search for them faarrrr away...
And I didn't like the movement system... Maybe pixel movement would be better...

This can be a funny survival game =] go ahead.
4  Discussions / General Discussions / Re: How long were you programming with Java before you made your first game? on: 2013-09-05 15:59:06
I didn't make my first game yet.

I started learning java at the start of this year, and I found Java interestanting and cooler than BYOND's programming language.

I study java ebooks just 1 hour per day(I'm sorry, they are not-paid ebooks, I know there's no excuse for this, but, there're no ways to buy java books here in Brazil, and my parents wouldn't help me pay them, in the future I will someway contribute with who helped me) and I'm afraid of moving to game programming without learning almost all basic things.

I also find the learning curve is a little slow.
5  Games Center / Showcase / Re: Ten Second Sketch [Ludum Dare Jam Entry] on: 2013-09-05 15:30:49
The best original, cool and challenging game I played this year.

You should create a multiplayer version where you challenge a person, then you and your adversary play in the same map(You wouldn't be able to bump with your adversary), and who survives for more time, or complete first, wins.

Amazing work, guy!
6  Games Center / WIP games, tools & toy projects / Re: The vigilante on: 2013-08-24 23:37:01
Oh, "Lucas" and "vigilante" are portuguese words, so I thought you were brazillian, I'm sorry.
Anyway, good work and good luck making your games, that's a good idea for a game.
7  Games Center / WIP games, tools & toy projects / Re: on: 2013-08-20 16:47:28
So, you were from Byond, I'm from there too. I know you're brazillian, so, sorry to english people that are reading this post. You probably won't understand.

Amigo, é de certa forma criativa a sua ideia de criar um jogo assim, eu nunca fui de gostar de Space Station, por isso talvez eu seja um pouco demasiado crítico com seu jogo, eu acho que os icons, eles não se "condensam", eles não fazer um bom papel ai porque eles se repetem, não se juntam para criar um icon "maior" e concreto, por exemplo;

http://www.byond.com/games/hubpic/99920_9561.png

Viu como o icon da água ficou bela, não repetida, pois ela se condensou com as demais águas e formou apenas um objeto, mas olhe para areia atentamente, ela ficou feia, com pontos repetidos no sombreamento e na iluminação, não precisa mudar isso no jogo se você quiser, é só uma opinião que talvez possa parecer pura ignorância, só te desejo tudo de bom e boa sorte com o jogo.
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.

Longarmx (39 views)
2014-10-17 03:59:02

Norakomi (31 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (57 views)
2014-10-14 00:39:48

TehJavaDev (58 views)
2014-10-14 00:35:47

TehJavaDev (48 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
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!