Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (121)
games submitted by our members
Games in WIP (577)
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 / Networking & Multiplayer / Re: Online score database, confused... on: 2011-07-03 20:34:46
Hmmm, does MySQL not have a different syntax in it's queries compared to traditional SQL?
2  Game Development / Newbie & Debugging Questions / Re: Transparent Game Menu on: 2011-07-03 19:35:12
Hi all, and thank you for your replies Smiley

What I've done, in resort as I could not solve my problem after trying all your suggestions, is instead use my Graphics2D object and a mouse event listener in combination with a Point variable to draw some boxes and listen for a click on them if the Rectangle drawn contains the Point co-ordinates whilst a 'ingame' boolean variable (and other related variables) is/are false.

This also proved as a funky way to animate and make the menu more elaborate Cheesy
3  Game Development / Networking & Multiplayer / Re: Online scores system for games on: 2011-07-03 19:25:07
Commented on your blog, will support as much as I can  Smiley
4  Game Development / Networking & Multiplayer / Re: Online scores system for games on: 2011-07-03 19:06:06
Exxxxxxxcellent!

I'm trying to make a plan for one, for my own project too. Quite interested, and will help where/if I can  Smiley
5  Game Development / Networking & Multiplayer / Re: Online score database, confused... on: 2011-07-03 19:03:55
Thanx for the response Riven!  Pointing

Are you suggesting I do something like have an Apache (or other) server running some webpages and a server application or applet to manage the database?

I have a colleague that has a server so doing this wont be a problem but I intend to test my theories an play around a bit before I move on drasticly, can you suggest any online webservers or services that are free to do such a thing? Or anything of the sorts? Online development is quite new to me and I've recently started learning JSP to script some webpages for my project, seeing as I have extensive Java knowledge already.

Thanks again  Smiley
6  Game Development / Networking & Multiplayer / Online score database, confused... on: 2011-07-02 13:01:18
Hi all Grin

Alrighty so straight to the question... Got a game working and want to host it on a website I created. Unfortunately I'm in a bit of a pickle now...

I created a scoring database which functions well with a test program on a local machine, and when I put the database on my website, I have no idea on how to link the program to the database.

Some additional information on the situation:
- The database is a Microsoft Access 2003 Database (with extention '.mdb')
- The database has its own url (eg: http://mywebsite.webserver.com/gamefiles/database.mdb)
- I use the JDBC/ODBC driver/bridge

Here is a code snippit:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
public DatabaseConnection()  //constructor method: sets up connection
      {
         try
         {
         String url = "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=XXXX";
         String nam = "name";
         String pass = "password";
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            conn = DriverManager.getConnection(
               url,nam,pass);
         
            JOptionPane.showMessageDialog(null,"Connection successful");
         }
         
             catch (ClassNotFoundException c)
            {
               JOptionPane.showMessageDialog(null,"Unable to load database driver");
            }
         
             catch(Exception e)
           
               JOptionPane.showMessageDialog(null,"Failed to get connection:\n"+e);
            }
      }


Where I put 'XXXX':
- Filling in the database name on the local machine works
- Filling in the online database url does not work, and a datasource name too long or other error is thrown.

Is there sometihng I am missing?
All comments are appreciated immensely...  Clueless
Thank you Smiley
7  Game Development / Newbie & Debugging Questions / Transparent Game Menu on: 2011-05-23 11:46:36
Heloha,

I would like to have a jPanel, which is transparent, drawn ontop of my game screen(which extends jPanel).
In my jFrame (or Main class), I add the game screen, and then my menu to the container.
However, when i do this, even when i the setOpaque is flagged false on the menu beforehand, it shows that nasty grey colour over the jframe and i cant see my game screen Emo

Any feedback would be much appreciated... Ive spent the past 5 hours programming different methods and cant seem to get it right... Clueless
8  Game Development / Newbie & Debugging Questions / Character Movement Bug on: 2011-04-18 08:30:23
Hello all Smiley

Ok so I've developed a small game and currently stuck on an annoying bug.

Bug description?
If a character is still, it reacts to the press of a movement key immediately moving in that direction (no matter what the new direction is...)
But however, once the character is in motion and a new movement key is pressed(i.e if the character moves up, and as the up key is released and the right key is released), the character faces the new direction with no movement for approximately 2, maybe 3 redraws (where 1 redraw is 80ms) before it starts moving again.

The problem I'm facing now is that if I change the update time for a redraw to something lower such as 30ms, the game operates faster, but how would I go about keeping the animation smoother without adding new images to my animation array?

Help would be greatly appreciated Smiley Smiley
9  Game Development / Newbie & Debugging Questions / Re: 2D Animating on: 2011-04-18 08:23:05
Ey Mads! Smiley

Ok cool, something I hope I can explain to you! Smiley

I struggled with this at first too, but I found some animation tutorials that helped me INCREDIBLY. They can be found at zetcode.com/tutorials/javagamestutorial/

In animation, it's reliant on the timer for updatin the graphics on the screen. When ever the timer reaches it's intervals at the given times, it must execute and/or process the following tasks:
1) to paint all the images on the screen by means of the repaint() method
2) update any variables where necessary, such as time, etc...
3) any other extras you may have added.

To animate the players character, its quite a simple process: increment the array point, of the array of images for simulating the person moving, by one through the interval of the update from the timer and when it redraws everything, according to the direction the character is facing.

Read those tutorials and keep in mind what I mentioned, I'm sure it'll help! Smiley
Keep well
10  Game Development / Game Play & Game Design / Re: Algorithm for Pattern game on: 2011-04-18 08:10:43
Ey there Smiley

I figured I could help when I attempted to make  a game very similar to this a while back.

If you would like the patterns to be completely randomized, you may create a method(or a few) to generate a pattern by means of a Random generator.

In a simple way, you may create a line to represent your pattern. The game I had was a lame attempt at a 4k game, where 5 circles were shown , and the 6th had to be guessed by the player.

There are 2 main things to take into consideration: how often your pattern will tesselate(or repeat) and how the data is selected to be shown(which colors to show).

By looking into this, you can code yourself a genertor for a random tesselation number and random numbers to represent an image to show.

Understand what I'm getting to?
Hope I helped a bit Smiley
11  Game Development / Networking & Multiplayer / Re: Online Scoring System on: 2011-04-18 07:49:11
Hi all!  Grin

Ok so I've been looking and observing and Googling and asking and... you get my point, about the different techniques I could use.

It seems as if sending data to a php page will be the most likely choice I will use... Sigh, I'll have to go and learn some new languages now (yay!)

Thanks for the link philfrei Smiley Pointing I'm looking into this game now (which by the way seems very well developed), but seems as if the reason why it has (or probably has) code for a scoring system is becaus it is scripted in Javascript, along with HTML and CSS...

Thanks all Smiley
12  Game Development / Networking & Multiplayer / Online Scoring System on: 2011-03-28 10:51:25
Hi all, (I'm baaaaaacckkk...)

In the process of completing a game for a company and will soon result in online deployment and a high scoring system...

One thing though, how would this be achieved? If it is hosted on a site, how would I go about having a scoring table? Would linking it to an SQL database as such be an option, and if so, how would I link the two?

I looked at other forum posts and the links they contained didn't help much.

Thanks in advance...
13  Game Development / Game Play & Game Design / Re: Sprite + background textures? on: 2011-02-07 13:36:55
Ah thank you very much, I really appreciate it. Smiley
14  Discussions / Miscellaneous Topics / Re: Back to the drawing board... Literally... on: 2011-02-06 09:04:36
Sigh I guess I'm gonna be the only person working on a Sunday?

Hahahaha  Grin

So a development blog is currently under construction to combine the features of twitter, facebrick and youtube... It's called... youtwitface.com...  Cheesy funny stuff there...
15  Discussions / Miscellaneous Topics / Back to the drawing board... Literally... on: 2011-02-05 19:48:12
Ok so busy with a little game for a company...

..and i finally got a chance to do a bit of testing today...

..but theres a bit of a drawing bug with my images...

..so i have to edit all of them again. Oh, and edit their layout upon the jPanel they're drawn to.

(winge) oh well:)
16  Game Development / Game Play & Game Design / Re: wan't to programming an RPG on: 2011-02-05 19:39:34
Ah I just came across something that may be of interest to u Smiley
http://markdamonhughes.com/Hephaestus/
It's a 2D game maker that creates RPG Java games... Enjoy!
17  Game Development / Game Play & Game Design / Sprite + background textures? on: 2011-02-05 19:33:55
Ok so I've created some really (really...) bad textures for a game I'm currently making, and would like to search for some more appropriate ones...

I've spent quite sometime searching the net now and going trough recent topics here on Java-gaming.org, but still can't find any suitable ones... I'm particularly looking for grass & water textures that aren't particularly realistic... Please help!  Cry

It's a 2D top-down game by the way.

Much thanks in advance... Smiley
18  Game Development / Game Mechanics / Re: Small animation trouble... on: 2011-02-03 18:07:27
Ah ok i see, that sould be pretty simple to progem then Smiley thank you Smiley

I've taken a bit of time to reconsider my sprites and characters and have made new images however they do have some transparent bits. They are all of the .png format, but you say this won't cause trouble in an animation since their transparency data is preserved?
By the way, I have analysed a few tutorials in order to get an idea of how to animate the images, and will be forming my own sort of way, which too will still add some sort of originality seeing as I just finished highschool and am new to this.

All seems to be going well, so far it's aporximately 20% or so completed. I will post the code once it is done. Smiley
19  Game Development / Game Mechanics / Re: 2D Walking Animation (edited - different approach) on: 2011-02-01 17:58:47
Hi Mads Smiley

I see youre predicament... Hmmmm i really havent done much to be able to help u with anything, but when i do i will post it here and show u. Because i am still pretty new to this forum, i cant past any links to websites, but please go ahead and type "pacman java 2d game tutorial" in Google and look at the one from Zetcode. It is what i am basing my animation around, also maybe look at their tutorial on animation itself and moving sprites, i think there will be valuable information in there to help u Smiley

Concerning the two integer variables, becasue its 2d we're working in, u may want a character to to so something really strange like strafe or side step, and u cannot account for that with one variable... but if you only intend to have the character going in the usual up/down/left/right sort of fashion, it can suffice too Smiley when i have some spare time this week, ill take a look at your code and maybe help out a bit if i can Smiley

I plan to have my project finished in the next 2/3 weeks before university starts
20  Game Development / Game Mechanics / Re: Small animation trouble... on: 2011-02-01 17:45:16
Hi philfrei Smiley

Quote
No reason why you can't take the man's X,Y location and print the sand bag relative to that.
I had this in mind but there are a few things I am confused about... The x,y co-ordinates provided, are they from the center of the mans image?

All the pictures I use are 100% opague fortunately. I dont intend to have any of the other images i may add any transparent either...
21  Game Development / Game Mechanics / Re: 2D Walking Animation (edited - different approach) on: 2011-01-30 11:36:12
Oh, and one other thing, it may be useful to use the 'Sprite' class found in the tools directory of your Slick download. It represents a single sprite in your program, but you could make an AnimatedSprite class which extends Sprite and impliments the above code or something somehow... Just an idea
22  Game Development / Game Mechanics / Re: 2D Walking Animation (edited - different approach) on: 2011-01-30 11:32:30
Hi Mads,

It seems like we are working on a similar sort of thing.

I had a look at Slick, but decided to only use Java2D instead of any extra libraries. My animations are controlled with 2 integers for the direction which the character is facing(dirx, diry, where -1, 0 and 1 are values). This will help determine which image set to render.

My images are seperated instead of being on an image set, but there will just be a separate bit of programming for you to do. Whenever the actionListioner() is called by your timer, another method will alter another variable which changes the image currently being displayed. Here is a code representation, please keep in mind this only represents a single direction:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
Image[] imgArr = new Image[3];//An array of 3 images, the images for your animation.
int currentImage=0;//An integer representing the current image.

public void changeImg()//A method to change the image to be displayed
{
currentImage++;//Increase the current image variable

if(currentImage==3)//If the current image is '3', which cant be used to get the image later, set it to 0.
currentImage=0;
}

public Image getImage()
{
return imgArr[currentImage];
}


This way, you can change the image in the paint() method of your program. Hope this helps a bit! Smiley
23  Game Development / Game Mechanics / Re: Small animation trouble... on: 2011-01-30 11:12:13
I was thinking having a horizontal image and a vertical image of the sandbag. When the appropriate keys are pushed(w,s,a and d are used to direct the man), a variable or two are altered and the sandbag is painted infront of the man's chest. I'm just a bit clueless about doing this though...  Huh

Hmmm... or I could have a two animation sets for the man, one with the bag, and one without, and use a rotation transformation on the images... But not too sure about this either and how it may affect performance
24  Game Development / Game Mechanics / Small animation trouble... on: 2011-01-30 08:09:17
Hi to all the avid developers/programmers out there Smiley

I'm currently in the process of developing a game(in a 2D, top-down view) which involves the animation of a man walking around, and has the ability to pick up a sand bag.

With that off my chest, I have a variable to detect which key is pressed to change the direction which the character is facing, and therefore alters the image loaded, as there are animations for every direction he faces. (ie. 4 pictures for moving up, 4 for moving left... and you get the idea.)

What im querying is how I would go about animating the sand bag in his hands? I feel creating a bunch of new pictures for the sprite and have a boolean variable to detect whether he has a bag in his possesion is going to unnecessarily increase the size of the executable, as I would like to keep it small.

Is there a possible way to instead draw the image x pixels infront of the character?

Thanks in advance for any help.
Keep it Java Smiley
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.

theagentd (18 views)
2014-10-25 15:46:29

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

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

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

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

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

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

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

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

BurntPizza (45 views)
2014-10-11 23:10:45
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!