Show Posts
|
|
Pages: [1]
|
|
2
|
Game Development / Newbie & Debugging Questions / Re: Transparent Game Menu
|
on: 2011-07-03 21:35:12
|
Hi all, and thank you for your replies  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 
|
|
|
|
|
5
|
Game Development / Networking & Multiplayer / Re: Online score database, confused...
|
on: 2011-07-03 21:03:55
|
Thanx for the response Riven!  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
|
|
|
|
|
6
|
Game Development / Networking & Multiplayer / Online score database, confused...
|
on: 2011-07-02 15:01:18
|
Hi all  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() { 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...  Thank you 
|
|
|
|
|
7
|
Game Development / Newbie & Debugging Questions / Transparent Game Menu
|
on: 2011-05-23 13: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  Any feedback would be much appreciated... Ive spent the past 5 hours programming different methods and cant seem to get it right... 
|
|
|
|
|
8
|
Game Development / Newbie & Debugging Questions / Character Movement Bug
|
on: 2011-04-18 10:30:23
|
Hello all 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 
|
|
|
|
|
9
|
Game Development / Newbie & Debugging Questions / Re: 2D Animating
|
on: 2011-04-18 10:23:05
|
Ey Mads! Ok cool, something I hope I can explain to you!  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!  Keep well
|
|
|
|
|
10
|
Game Development / Game Play & Game Design / Re: Algorithm for Pattern game
|
on: 2011-04-18 10:10:43
|
Ey there  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 
|
|
|
|
|
11
|
Game Development / Networking & Multiplayer / Re: Online Scoring System
|
on: 2011-04-18 09:49:11
|
Hi all!  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  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 
|
|
|
|
|
12
|
Game Development / Networking & Multiplayer / Online Scoring System
|
on: 2011-03-28 12: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...
|
|
|
|
|
15
|
Discussions / Miscellaneous Topics / Back to the drawing board... Literally...
|
on: 2011-02-05 20: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:)
|
|
|
|
|
17
|
Game Development / Game Play & Game Design / Sprite + background textures?
|
on: 2011-02-05 20: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!  It's a 2D top-down game by the way. Much thanks in advance... 
|
|
|
|
|
18
|
Game Development / Game Mechanics / Re: Small animation trouble...
|
on: 2011-02-03 19:07:27
|
Ah ok i see, that sould be pretty simple to progem then  thank you  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. 
|
|
|
|
|
19
|
Game Development / Game Mechanics / Re: 2D Walking Animation (edited - different approach)
|
on: 2011-02-01 18:58:47
|
Hi Mads  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  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  when i have some spare time this week, ill take a look at your code and maybe help out a bit if i can  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 18:45:16
|
Hi philfrei  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...
|
|
|
|
|
22
|
Game Development / Game Mechanics / Re: 2D Walking Animation (edited - different approach)
|
on: 2011-01-30 12: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];int currentImage=0; public void changeImg(){ currentImage++; if(currentImage==3)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! 
|
|
|
|
|
23
|
Game Development / Game Mechanics / Re: Small animation trouble...
|
on: 2011-01-30 12: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... 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 09:09:17
|
Hi to all the avid developers/programmers out there  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 
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|