• Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Codejoy

  • Rank
  1. Still don't know what I am doing wrong...I tried a few other things with no luck :(
  2. Okay this method isnt working for me, but I am sure i am coding it up wrong: First of all if there is no system failure, I just want the needle to gentely osscilate back and forth. It was suggested to just take the value and add in some randomness so I did this: int val = (int)(Math.random()*10)-5; value100 += val; (this works okay, but it eventually does creep out of the bounds). Now if it is a system failure I do this: long timeVal = (long)(Math.random()*4000)+8000); //get number between 8 and 12 //miliseconds //targetValueDeviation=200 for this trial, so if the needle moves more than 200 //clicks either direction system failure: long currTime = elapsedTime-startTime; int val = Math.max(targetValueDeviation, (value100+(targetValueDeviation-value100))*((int)(currTime-timeVal))); value100 = val; The SF version doesnt do anything, as the value usually stays around 200 or whatever the targetValueDeviation is, I might of misunderstood...or typoed. any help? thanks, Shane
  3. I thought about the sine waves, but just didn't have any clue how to make that work...i mean i know on paper how that would kinda work, but wasn't sure how id code it up. This part of the project im working on I put off thinking it wasn't going to be that hard, then more and more rules got piled on from the designer and now im left trying to finish this project and this is what is holding me up...I will admit I sorta wanted a quick fix that would work within the architecture I have already. Basically the guage is a simple thing that draws itself and every frames (60fps it runs at) updates its value (either its 1000's hand or its 100's hand) so if i have an altitude of say 5300 then the 1000's hand points at the 5 and the 100's hand points at the 3... simple enough just didnt know how to make that hundreds hand creep out of bounds ... so using something more like my code to code up KelSeran's suggestion would look more like: public update(long elapsedTime) { if(isSF) { value100 = Max (targetVal, value100 + (targetVal-value100) * (elapsedTime -(random(8000, 12000))); } else { value100 = value100 + small_random_value } } what i dont get is if its not a system failure, just adding a small random value each frame could perhaps make it move out of bonds if suppose the guage was 5300, and the out of bounds value was say 50. Or if the trials run longer than 30s (they shouldnt but dont know how it would work in future use).... or something close, where the value100 is a local member value holding the 100's value, and the targetVal is the bounds (the value +- it can go) that is set at random at the begining of each trial. This is in java using the Golden T game studios engine (its pretty nice) :) so i will code this up tomorrow and see how it works.
  4. Let me get this straight, V is the random value of the gauge. I am working with two (what the gauge starts at, some altitude) and the second one is the +- bounds value. When you say V is the random value of the guage do you mean the +- bounds value? and if so then random_value would be some new (small) random_value i calculate? thanks for the help here, this is helping...
  5. I have this simulation I am running...there is a guage that represents an altitude. The guage should move randomly staying within a certain range, once in a while there is a system failure (at random) that occurs in a simulation trial (before trials are ran a trial is designated as failing or not in an input file). If a trial is to fail, then the guage hand has to move out of bounds (that is it moves beyond some threshold +-, this threshold is set at random at the begining of each trial). If the trial is not to fail, then the guage should move randomly between the bounds and never go out. If the trial does fail then the guage hand is never to return "inbounds" for the duration of the trial (30 seconds each). This would be pretty easy, I could see if the trail fails, and if so set up a state machine that would just move the guage in a certain direction ensuring it to go out of bounds...what makes this problem difficult is: 1) The guage shouldn't just dart out of bounds on failures, it should ossiclate randomly, that is to say it should just look like a normal trial except it "creps" out of bounds. 2) On trials with a failure, the guage has to fail (i.e. go out of bounds) within 8-12 seconds of begning the trial. So the second stipulation is what makes it hard, I have no clue how to ensure a guage hand creeps out of bounds in the alloted time, because the bounds is a random number between 100 and 999. So each trial the bounds changes, so I cannot code agasint a constant bound value. I have to see the bound value and then creep twards that finally going past it at the 8-12 second mark. And the guage hand has to do this smoothly, it cannot just dart out of bounds when the 8 to 12 second time is up. So I hope I explained myself enough, I hope the problem is clear enough, and I hope someone looks at this thread. I am not asking for the exact solution (as I am sure there are many) I am just wanting to get some ideas how to solve this, cause I have been racking my brain trying to come up with a good solution... thanks in advance, Shane p.s. i might cross post this cause I am not sure which topic this belongs in.
  6. well just something simple that i can do gui mockups really quickly...
  7. Does one of these exsist? I know visio has a nice windows user interface template but i dont own visio :( and i like how that works with the widgets and all, any other pgoram thats free out there do this? I tried googling but i must not know what to call it to search on...
  8. I was looking into this book for java midp1.0 programming:
  9. I was looking into this book for java midp1.0 programming:
  10. The book is beginning mobile phone game programming (or something like that), I actually fixed the problem as realized it was the design of his demos that was throwing me off in the way the view and player positions were updated, I changed that and it's more or less working. Ya I knew midp1.0 is still on other devices, but I wanted to get a solid demo of the game working on one device, and then work on "porting" it to the other devices... I do think midp2.0 is quite nice thus far...
  11. I guess not, like i said I was just going off what I learned from that one book...and while I can do it several different ways, I figured id pop in here to try to come up with the "ultimate" best solution... I could build a collision map I suppose of some sort and test that way and write functions like xVel = barrierLayer.CanMoveLeft(xVel); or something that can return the needed velocities after collision is done.
  12. Okay going only by what I have in my learning to program midp2.0 games book, the author uses this method to do collisions: if(xMove!=0 || yMove!=0) { layers.setViewWindow(xView+xMove,yView+yMove, getWidth(), getHeight()-infoBar.getHeight()); playerSprite.move(xMove, yMove); } ... if(sprite.collidesWith(barrierLayer, true)) { layers.setViewWindow(xView,yView, getWidth(), getHeight()); playerSprite.move(-xMove, -yMove); } else { xView+=xMove; yView+=yMove; } this is fine and dandy for his examples where you run around into barriers or wall, but can only move one way at a time. It seems collidesWith falls apart when trying to do something like a platformer. For instance: Suppose you have a player runing to the right. YOu want to have ac onstant x motion right unless he hits a verticle wall, then stop. And you want a constant down motion to keep him on the ground (and fall if any pits appear). So this is my thinking: in canvas.Update(){ if(xMove!=0 || yMove!=0) { layers.setViewWindow(xView+xMove,yView+yMove, getWidth(), getHeight()-infoBar.getHeight()); playerSprite.move(xMove, yMove); } ... .. .. if(sprite.state == RUN) { xMove =4 ;//always run right //check for collisions while moving right if(playerSprite.collidesWith(barrierLayer, true)) { layers.setViewWindow(xView,yView, getWidth(), getHeight()); playerSprite.move(-xMove, 0); } else { xView+=xMove; playerSprite.nextFrame(); //animate since we are moving } //now force some gravity and test y direction: yMove=1; if(playerSprite.collidesWith(barrierLayer, false)) { layers.setViewWindow(xView,yView, getWidth(), getHeight()); playerSprite.move(0,-yMove); } else { //we are not hitting a barrier, must be falling playerSprite.state=FALL; yMove=4; } } else if(playerSprite.state == FALL) { //test xdirection movement collision xMove=4; //fall the direction we were going //test that we dont hit a while while falling down right if(playerSPrite.collidesWith(barrierLayer, true)) { layers.setViewWindow(xView,yView, getWidth(), getHeight()); playerSprite.move(-xMove,0); } else { xView+=xMove; } //now test the ymovement fallign collision yMove=4; if(playerSPrite.collidesWith(barrierLayer, true)) { layers.setViewWindow(xView,yView, getWidth(), getHeight()); playerSprite.move(0,-yMove); yMove=0; playerSprite.changeTo(RUN); playerSprite.state=RUN; } else { yView+=yMove; } } this more or less works the way I want but two problems: First I realize the collidesWith could care less about direction so im doing a ton more checks than I need...its split up cause it makes sense in my mind that way... secondly for some reason, and its not apparent in my above code...the player runs at like half the speed... if i take out all the falling yMove crap in my RUN state, then it runs great (of course doesnt "snap" to the floor). So how does one use collidesWith in a platformer like setting, knowing what tiles? I had a thought of creating two barreirs: Verticle, and Horizontal , so depending upon what direction I want to check for for a response to colliding with, I know i can tell it to check against the proper orientation for the right direction (x or y). So anyone got some cool ideas tricks or even have a clue what , even if in general, my dilemma is? thanks, Shane
  13. yet again thanks for the info shmoove :) you are the most helpful on this stuff! :) WEnt to forum nokia, dang big ol site...I take it I want the SDK which im guessing has the emulator in it? (can't download now not at home computer :( ) thanks though again shmoove, you've been most helpful on this cell phone adventure (in this and other posts)
  14. I am using netbeans mobiltiy pack etc...and Iw ould like to know how to extend the emulator optionsI have, the ones there nice (like defaultcolorphone) but don't seem very geared twards a realistic market share handset (as its screen size is way bigger than 128x128)...I would like to know what steps I need to take to create my own settings that make the emulators run with a 128x128 screen if possible? Or do I have to find somewhere a emulator to download another platform to add to my platform folder that has 128x128? thanks, Shane
  15. So I posted this post here: a while ago, and got some great feed back (Thanks guys). Though the original reason for the post has changed, the feed back I got thankfully was generic enough to help me on future endevours... for instance: The original post was spawned by the fact I couldn't get past a few design hurdles with this game idea I had, and after fighting with it realized to let this super experimental complex game idea mill for a while and go back to something thats totally shallow, simple yet fun. So that said, there needs to be a survey that shows what exactly the mobile market can sustain in terms of game genre's, i mean, lord of the rings came out for wireless phones and its gotten good reviews but looks super complicated (And lets face it anything requiring two button simultaneous controls sucks on most phones). So at what point does one say "My idea is to shallow to fly, even on a cell phone?". I generally have great issues with "keep it simple stupid" as I manage to take a super simple idea and feature creep it into some monstrosity, I caught myself doing that with the experimental platformer mobile game earlier and decided to take a few steps back for several reasons: The simpler idea is way easier to code, and mostly (What my other thread dealt with sorta) deal with asset design and management for. I got a working demo of the simple idea up(it was a very very incomplete simple demo) played it and caught myself saying "ya this could be fun", and gave it to some other friends to try and they said they liked the idea alot. So here I am, I have a simple idea I want to make a bit more deep without feature creeping the thing. I generally want to start the design doc process to really hammer the idea out before I start coding and directing artists what to do, but alas, where to go now in the design document? Design the enemies? level encounter ideas?(this game is like a shooter but with a huge twist and a few other differences, but best can be described as a shooter that instead of avoiding intesne fighter, requires you to be rythmic in your attacks cause timing is key). So how do you others attack design? what parts you design first? Story (in a mobile game, sure but how big of story, how best to convey it etc...?) game flow? asset flow? etc... just curious to see how others do it. That said, and asked, I can safely say getting a playable demo up asap is one of the best things anyone can do for any project. -Shane