Results 1 to 6 of 6
- 09-10-2011, 07:10 PM #1
Nightime, any ideas how to add that to my game?
As many people know (I've been asking questions about my game earlyer (How do I do?)) my game is pretty much only JPanels & JLabels. I've been for a long time (But I don't have any ideas) wanted to add nightime.
There are two different layers.
The GlassPane layer, where I have the character & mobs.
The Normal layer, where I have ground / things that you can walk on.
What I need is some way to add nightime.
Would be great if I could add multiple layers to the GlassPanes JPanels (If possible).
Because I want to be able to set up like torches in the game. Which will provide light.
Thanks,
AhCurrently Developing a Game Called Loaie, You Can Download It From "The Loaie Website".
- 09-10-2011, 09:51 PM #2
Re: Nightime, any ideas how to add that to my game?
Maybe you should take a look at JavaFX 2.0, currently in beta. JavaFX haslighting effects.
Note that it's non-trivial to mix Swing and JavaFX and that FX effects can only be applied to FX Nodes (equivalient of component in AWT/Swing).
db
- 09-11-2011, 12:57 PM #3
Re: Nightime, any ideas how to add that to my game?
I think this would be a littlebit too advanced for me.
Are there any easyer way? :-/
But thanks anyways! :-)Currently Developing a Game Called Loaie, You Can Download It From "The Loaie Website".
- 09-11-2011, 03:52 PM #4
Re: Nightime, any ideas how to add that to my game?
That is the easier way!
db
- 09-12-2011, 01:44 AM #5
Member
- Join Date
- Aug 2011
- Posts
- 31
- Rep Power
- 0
Re: Nightime, any ideas how to add that to my game?
i looked at your game on youtube, i had an idea, you could used timed animations to change the contrast of each individual square :) althought that might take a while
- 09-12-2011, 03:04 AM #6
Member
- Join Date
- Sep 2011
- Posts
- 42
- Rep Power
- 0
Re: Nightime, any ideas how to add that to my game?
Well I actually have my own "particle emitter" and "lighting" classes set up. The particle emitter one is a bit more advanced, but the lighting one is pretty easy. Basically you chose a point on the JPanel to start. Then you choose the range. Then you choose the falloff. Then, using some polar graphing stuff, you create multiple rings around this point. Each pixel will have it's RBG value modified slightly, to make it a little bit greyer. Then, as this gets further out, the amount that is changed is reduced based off of the falloff value. The hard part here is modifying the byte and bit code of the pixels, which isn't really too hard as long as you use some of the default methods to convert them into the 255 code that you are used to.
But yeah, you could try something like that if you want.
Similar Threads
-
Game ideas please?
By clydedoris in forum New To JavaReplies: 6Last Post: 02-26-2010, 03:08 AM -
very void here, game ideas needed
By j2me64 in forum Java GamingReplies: 4Last Post: 02-25-2010, 07:49 AM -
Need ideas here
By Manfizy in forum New To JavaReplies: 0Last Post: 07-30-2009, 08:07 AM -
Need ideas and help for a simple BlackJack Game
By Dannii in forum New To JavaReplies: 5Last Post: 04-27-2009, 10:53 AM -
out of ideas
By v1nsai in forum New To JavaReplies: 2Last Post: 03-27-2009, 01:35 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks