Eat ALL the Fruits!

Only my second “game”. Go easy on me :wink:

Game - http://www.mediafire.com/?ubbotu48s44ckqc

Source - http://www.mediafire.com/?b4g6urw4bmmj907

-Nathan

p.s. I know there isn’t an animation for when you move; I’m making new sprites now that aren’t stolen from another game (which will remain nameless…)

People usually wont download or try your game unless you give pictures.

so, pictures please :slight_smile:

Pretty good for a second game.

The only thing I dont like that is the jumpy movement. Would be better (i think) if you made the movement smoother maybe?

I did that because it uses a 2D array to hold all the data, so if I wanted it to be smoother the 2D array would have to be massive.

oh I see.

Why did you decide to do it like that?

I don’t remember :x Maybe I’ll try making another, smooth-walking version.

at start I can hear my GPU and then my cooler going wild

meaning this isnt running at 60 fps but rather full speed
please fix =D

yea, in your main update loop put in a sleep so that it does consume a huge
amount of processor.

I have a gaming rig and its eating 25% of my processor. Should be less than 1%

so just add a 5 millis sleep to your main while loop and that should solve it.

Runs fine at 7000FPS :slight_smile:

It is still possible to do smooth movement in a 2D grid world. You just have to interpolate between the old point and the new point.

I have it yield. I have heard that this is better. I have the ticking and rendering separate, with the rendering unlimited and it ticking 300 times per second. Is that too much? Ra4king - no way! Can you explain how That would work, or link me to a tutorial? Sorry for formatting, I’m on my mom’s iPhone haha. Thanks!

It’s simple, you get the distance in X and Y between the new point and old point and divide each by the number of ticks you want to move the sprite then store each value in X and Y velocity variables. Each frame you add the X and Y velocity to the X and Y until you reached the new point.

For example, the player is at (50,50) and needs to go to (30,40) in 10 frames, the difference is (20,-10) divided by 10 = (2,-1). That’s your velocity per frame.

The coordinates of the player in my game only go up to 12, I just multiply it by 15 to make the frame make more sense. Could I still do this? Would it work with decimal points? My array has to round to an int; that’s what I’m worried about.

Ah so each cell is 15x15. Then change your player coordinates to pixels and then divide by 15 to get the cell.

Hadn’t thought of that! Thanks :slight_smile:

Also, I am still flabbergasted on spawning enemies and such. :’(

Having it yield is not going to slow down the while loop. there is no reason to have a while loop running at the max speed your computer can process at.

Having it do that, will just have it completely consume your computers processing power and on a lot of computers people will get “lagg” from this and
possibly other issues.
So you really do need to add a delay in your while loop.
I suggest having it just sleep for about 25 millis.

To put this into perspective. your game, which is extremely small and hardly any math calculations and collision detection going on is
making my gaming rig use 30% of its processing power. Where is my current game “Epic Stubble Man” has a ton more math calculations
and collision detection going and its using only 1% of my total processing power.

Hehehe I think you quoted the wrong text :wink:

lol woops my bad. let me fix that.

Hmm okak, I’ll think about it.

AND RA4KING I UNDERSTAND NOW. About spawning enemies! Look! - http://www.mediafire.com/?wnwf728uw5wkc4f

I feel really good right now. I have been trying to understand that for a month. 8) 8) 8)

Nice! Great job :slight_smile:

I can’t fall into the pits. Closing all the pits doesn’t trigger any kind of win condition. I figure you already know this.

Runs fine on my MacBook Pro. You’re off to a good start!