Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 Mar 2013
Offline Last Active Jan 05 2014 09:07 AM

Posts I've Made

In Topic: Help me with code ideas please?

05 January 2014 - 07:32 AM

Ahh...  Thanks!  That put's things a little clearer than what's been explained in the past or in classes. It's given me a bit to chew over for the future. It's also given me a more concrete reason to organize in objects. I've always been told to just do it. It's never made sense why creating multiple objects for a single use, small program made sense though. I always thought it would make more sense to separate the code into methods/functions for a tiny program (sub 150 lines) to make the program more concise and easier to follow. 


I figured JavaFX was becoming the newer standard. I didn't read anything pointing at that though. There's so much information out there. That's my biggest issues, is reading and organizing all that information. It seems as if there is a different opinion or paradigm for everything.  I was also using the grid bag layout from AWT I believe. I'm not to far into the program, nor is it complicated. I might scrap it and rewrite in JavaFX. That might solve a problem I was having with buttons no being destroyed and recreated properly. Nonetheless, If I continue to have the issue I think I would rather have it with newer standard. That way when I learn the resolution it's more relevant.


I've run across the idea of a singleton pattern. Now I'll read about it. It sounds as if it could be a useful paradigm to learn.


Thanks again! I know it takes a bit of time to write all that out and you offered it to me for free. I really appreciate it!

In Topic: Help me with code ideas please?

04 January 2014 - 06:28 PM

Thank you for the feedback subtle_wonders.  I didn't go to far into constructing the code with best practices for Java as I know them because I was only testing an idea. The algorithm may eventually be ported to Construct 2 for a game.


With that said though, I'm still very much a novice. I have a question. With Java best practices, is it always better to shove things into a separate class or is it acceptable, if the program is small, to keep it all in a single class? What's the pros and cons? 


I actually deviated at the moment as suggested to make a minesweeper game. The logic was a breeze to zip through and gave me some better ideas to implement somethings for a planned game down the road. It actually became a better exercise in the Java GUI classes. They still confuse me just because of how many there are. I got a really good intro to the grid bag layout. 


I digress though... While making the new minesweeper program I kept everything in a single class. I figured the program is small so it would create more work than needed for a program that doesn't really require any scaling later on. I separated everything into functions in the main class instead. I then made a lot of variables and objects as whole class variables and objects and labeled them as static. I did this because there would only ever be one game running at once and I would be destroying and remaking everything on resetting the game. My presumptions also guessed that doing this would make the program leaner on memory use and garbage collection. I was reading a bit on how Java and Javascript do this (two different languages, I know) and it was a practice on controlling that.


What are the thoughts on those ideas?

In Topic: Help me with code ideas please?

31 December 2013 - 01:51 PM

Thank you d4n1!!!


So (and I apologize for the details now) I have been thinking about making a mindsweeper clone since I wrote the last post. I was taking a poop today and was thinking about the algorithms involved. I quickly stepped through it and thought of how I would roughly program it. Than it hit me that I could make random patterns of rooms and implement a corridor system with a very simple separate algorithm. It would create a much better effect than the code I have listed above and would ensure a random, but exact path through every single time! 


You're suggestion was awesome!

In Topic: Help me with code ideas please?

30 December 2013 - 05:42 PM

Thanks guys! The kind words are nice to hear.


I think I might make a quick mine sweeper type protoype game in java then for the experience. I can understand why you'd say I would benefit from it. I don't think I would need to add a lot of polish to the game. It sounds like the learning experience would be in the algorithms to make the game work. It sounds like it would be a good experience. 

In Topic: Help me with code ideas please?

30 December 2013 - 03:51 PM

Thanks for the tips. Initializing everything to 0 was beaten into me in a high school programming class years ago. I've never shaken that habit. I like the criticism for everything else. That helps a lot.


I'm not sure if I can use enum. I'll have to go look at Construct again and see if there is a way to do something similar. Ultimately I plan to translate this to Construct for a game idea later on. That idea is being put on hold for the moment but I'll be getting back to it in the next few weeks.