Jump to content
Existing user? Sign In

Sign In



Sign Up

A Long Hour and a Half, a Java game


Recommended Posts

  • Replies 132
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

So, currently, I'm working on a game that runs on java, seeing as I (kinda) know javascript. No doubt most of this code could be replaced with something better, but I just wanted to show the progress

"After 6 months in development, hopefully it would have been worth the wait." Here is the update with a couple of new features as improved game parameters window, "Reset" and "New game" buttons,

I didn't want to post again until I had the build ready, but TheGreatNobody points out something I actually haven't really touched on except with those helping with the code. Oh, but first,     No

Posted Images

I would really love to play this game once it's finished.  Thank you for your efforts.

 

No need to thank me yet, it's not even interactive yet >_<

My modesty aside, thanks anyways ^^

 

Keep us updated!

 

I will! I'm definitely enjoying coding this, so I'll be sure to update whenever I make any big progress!

Link to comment

Cool, I would love to see how this progresses.

 

Sounds fun. I'm getting excited just thinking about playing this.

 

This sounds like a lot of fun.

 

I'm glad you're all looking forward to it! I'm still typing code for it, so no new build so far (wouldn't really call it a build, either, seeing as it's only for testing purposes currently).

 

Cool idea!  I'll keep an eye on this.

 

Also, I feel it my duty to point out that JavaScript has nothing to do with Java.  I know it's confusing, but such is the convoluted world of software.

 

I hope not to disappoint!

 

Ah, yes, I think it crossed my mind to type everything that I said Java to JavaScript to avoid confusion, but I was tired and needed at least a couple minutes of sleep. Either way, I'm glad you understand the difference  :happy: (I'll try to keep from making the same mistake again ^^; )

Link to comment

Yeah, I've done a little in both Java and JavaScript.  This is, of course, Java.  I don't have much experience using Swing, but there was a time I wanted to do something very similar to what you're doing.  Actually, I still kinda do, but I'm always moving from language to language, so if I ever settle on one maybe I'll develop something too ^^

Link to comment

Yeah, I've done a little in both Java and JavaScript.  This is, of course, Java.  I don't have much experience using Swing, but there was a time I wanted to do something very similar to what you're doing.  Actually, I still kinda do, but I'm always moving from language to language, so if I ever settle on one maybe I'll develop something too ^^

 

Well, I look forward to anything you try to produce! I always think there aren't enough omo games.

 

I am looking forward to this game. I also wish I could program something as well as it would be great to make up a game of my own. Shame I can't really :( haha. Keep up the good work :) Looks like it will be really fun to play :D

 

Thank you, and I'm sure that, with enough effort, you can program something (I mean, that's basically what I'm doing)!

Link to comment

I'm excited for this game! Fully interactive/customaziable omorashi games are hard to come by, for obvious reasons, so I'd excited to know one like this is currently in the works.

 

That's exactly the reason I came up with this! There's a decent amount, but there just aren't any ones with customization that are complete (the closest we have is "Average Life", which hasn't been updated in forever!

 

Sounds great--good luck getting this up and running!

 

Thanks! I'm having a few small problems, but so far nothing that's keeping it from completion.

 

Speaking of small problems, seeing as I'm planning on not releasing an update yet, here's just something that I found interesting.

So, for whatever reason, an if statement with hr++ (adds one to hours) seemed to pass its if statement every time, despite it needing minutes = 60 AND hours = 0, so every 3 minutes (each round ingame is 3 minutes currently) hours rised. What's worse is that it kept some other code from executing, so I'll have to figure out what to do with that later.

 

Anyways, as for another problem, I'm way too lucky. So, every 15 minutes, someone is called on in class (except 90 minutes in, as class is dismissed). so, I wanted to test something out that utilizes this code:

int rollcall = generator.nextInt(numClassmates) + 1;

For those who don't understand, rollcall is the one that will be used later, with 1 being you chosen to come to the front of class. Now, numClassmates is the number of classmates including you (the + 1 simply is used to make it 1-20 instead of 0-19). Now, you might see the problem already, I have a 1 in 20 chance to be called on in class, and everyone else is being called on, because I'm just that lucky. How lucky, you may ask? Well, after 50 passes (ten attempts of the code) I managed to not get called on once. Heck, whoever classmate 14 is got called on 8 times! Poor classmate 14...

Anyways, I can fix the test by setting rollcall to 1 and skipping the generation, but I just found it funny.

Link to comment

So, for whatever reason, an if statement with hr++ (adds one to hours) seemed to pass its if statement every time, despite it needing minutes = 60 AND hours = 0, so every 3 minutes (each round ingame is 3 minutes currently) hours rised. What's worse is that it kept some other code from executing, so I'll have to figure out what to do with that later.

Sounds like either your condition is wrong or the increment is not within the body of your loop (or whatever construction you use to pass to the same if statement multiple times.

Also not that e.g. when "int i=0" "i++ > 0"will be false as "i++" increase i after it was evaluated, as opposed to the less famous "++i", which will increment i and then evaluate.

Anyways, as for another problem, I'm way too lucky. So, every 15 minutes, someone is called on in class (except 90 minutes in, as class is dismissed). so, I wanted to test something out that utilizes this code:

int rollcall = generator.nextInt(numClassmates) + 1;

For those who don't understand, rollcall is the one that will be used later, with 1 being you chosen to come to the front of class. Now, numClassmates is the number of classmates including you (the + 1 simply is used to make it 1-20 instead of 0-19). Now, you might see the problem already, I have a 1 in 20 chance to be called on in class, and everyone else is being called on, because I'm just that lucky. How lucky, you may ask? Well, after 50 passes (ten attempts of the code) I managed to not get called on once. Heck, whoever classmate 14 is got called on 8 times! Poor classmate 14...

Anyways, I can fix the test by setting rollcall to 1 and skipping the generation, but I just found it funny.

This isn't funny nor odd behaviour. Computers do defined things, so by definition can't do anything random. So called pseudo-random number generators are quite good at ensuring what seems to be randomness in their output, but that's within a pRNG. You're probably testing with a new one each time 'though, as you're running your program again, and that gives far from random behaviour. Edited by ola93 (see edit history)
Link to comment

Sounds like either your condition is wrong or the increment is not within the body of your loop (or whatever construction you use to pass to the same if statement multiple times.

Also not that e.g. when "int i=0" "i++ > 0"will be false as "i++" increase i after it was evaluated, as opposed to the less famous "++i", which will increment i and then evaluate.

 

Well, the original statement was:

if (min == 60 && hr == 0)

     hr++;

 

I never heard of ++i before, I need to look up the uses of both.

 

This isn't funny nor odd behaviour. Computers do defined things, so by definition can't do anything random. So called pseudo-random number generators are quite good at ensuring what seems to be randomness in their output, but that's within a pRNG. You're probably testing with a new one each time 'though, as you're running your program again, and that gives far from random behaviour.

 

Hmm, well, pseudo random or not, it's just a small check that I want to happen a fraction of the time. I might want to mess around with the numbers to make it more or less likely, but 1-20 seems to be giving me good enough results currently, as I did a few more tests and got 1 called 3 times on the same test. Basically, I just want a chance of it happening, whether none, once, or multiple times in one go. Plus, if I increase the counts it uses (goes through schoolday) then it should give me slightly more random results.

 

Thanks for the help!

Link to comment
 

That should work. Could it be you're accidenly modifying i again before the if-stament is reached again, e.g.
'while (whatever) {
int hour= 0; //n.b. sets hour to 0 in each iteration
if (hour == 0) { //n.b. always true
hour++;
}
}'?

 

nope, the only instance of hours being set is before the while statement. If you want, I can send you the current version of the code to look over.

 

This is cool thanks for the work! Do you plan on adding pictures and such or purely text? I just ask because if you use text it might be easier to make this a console application instead of using the swing elements.

 

Anyway, keep up the good work and let me know if you need help. I program quite a bit.

 

Ah, yes, I understand perfectly what you mean, but even though I am not using pictures, the reason I'm using the swing elements are to make it less likely for the user to utterly crash the program. That, and I really would like this to have buttons for certain choices. While having a string entry for stuff like, say, the clothing, or even asking for a letter for the actions, there are certain descriptions that fit better for some clothing (not to mention it'd be easier to rechoice something instead of having to type it again), along with the fact that the actions would all have to be stuck in their own while loops if they hope for a wrong input not to crash the game or force a default option. Hope I didn't ramble too much with that ^^;

 

I'll keep it in mind! Any small problems I have I'll mention here, big problems I'll start shooting people PMs.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...