Jompe_71

Members
  • Content count

    5
  • Joined

  • Last visited

Community Reputation

166 Neutral

About Jompe_71

  • Rank
    Newbie

Personal Information

  • Interests
    |programmer|
  1. A few years ago I did this remake for Android and iOS but I never bothered to update them so they got removed from both markets. To be honest, it wasn't very popular on any market and the coding lacked support for different screen sizes. Trying out some new things and decided to put it up for free again on Google Play so some old AppleII/C64 nerds can remember how hard the game was :) This time all screen sizes are supported and I will fix the criticism in some of the feedback reviews I got when it was still published.  
  2. I'm sure that whatever language you are using (your code snippet can be several) there is a Rectangle implementation in the core API which has an intersects( anotherRectangle ) method?
  3. I would start by separating animation logic from the draw method into an update method. Secondly I would the make the animation logic framerate independant. As it is now it's written in a frame dependant way which causes the animation to look different depending on the speed of the machine.   I'll try to do some pseudo-code below to show how I do animation logic myself below.   // Animation frames ( can be used for longer intervalls of certain frames as shown using the frame 4 more than the others ). private int[] animationSequence = { 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 4, 4, 4, 3, 3, 2, 2 }; // Animation framerate. private float animationFramerate = animationSequence.length / 1000F; private int currentFrame = 0;     public void update( long ms ) {   currentFrame += ms * animationFramerate;  if( currentFrame > animationSequence.length ) { currentFrame %= animationSequence.length; } }     Thats pretty much it for the lazy-mans version. There are some fixes which could be made for even better synchronization. Thats by adding logic which can handle "half" frames. You can then use a variable for time spillover, i.e. when you show frame N and you still have som time left on that frame before moving into the next one.    In the above code, there are two ways to tweek your animation speed. One is to change the value of 1000F to either a higher value (slows down the animation) or vice versa for a faster one OR you can alter the animation sequence to have more frames of the same index in a row. When it comes to the rendering part you have two options as well. Either treat the index value in the sequence as an Image in your array or my preferred choice an offset in a sprite-sheet.
  4. Game Loop locking up my game

    Seems you start and set the game running (basically an eternity loop until members isLooping && isRunning is set to false) from the onMouseClick. OnMouseClick is probably called by some thread in Swings complex thred/event handling mechanism and you freeze it with your game loop.    I would suggest that in event callback methods called by Swing you just set flags which hits the Game class what to do and then handle those flags in the main game loop instead.
  5. Hi,   How do you "usually" handle to option in a game to toggle music on/off. Do you load/unload the sounds or do you load all sounds on startup and just toggle the volume between mute/unmute to save load time and potential lag?   // Jonas