Jump to content
IGNORED

Mr. Frog


atari2600land

Recommended Posts

So, what do you think?

I think you need to replace the music.

 

(Right hand) C E G E F D E
(Left hand)  C A F A G B C
(Right hand) C E G E F D E
(Left hand)  C A F A G B C

 

(Sorry, couldn't resist. :P)

 

I think it's actually your best platformer yet. It still needs some tweaking, but it's a great start. A few suggestions:

 

1. Allow the frog to walk slowly. The jumping is great, but it would be nice to be able to adjust the position of the frog without hopping. Think of Frog Pond on the FB2.

 

2. Fix it so that you can't hop halfway up walls.

 

3. Fix the bug where the frog can keep jumping on the final pad to drive up the score.

 

4. After the final pad, Mr. Frog falls through the floor. Is this supposed to happen?

 

5. Replace the music with "Mr. Frog is full of hops." :D :P

Link to comment
Share on other sites

1. Allow the frog to walk slowly. The jumping is great, but it would be nice to be able to adjust the position of the frog without hopping. Think of Frog Pond on the FB2.

 

2. Fix it so that you can't hop halfway up walls.

 

3. Fix the bug where the frog can keep jumping on the final pad to drive up the score.

 

4. After the final pad, Mr. Frog falls through the floor. Is this supposed to happen?

1. Will do.

 

2. This is a far-from-done version, as you know, and this'll be taken care of.

 

3. Again, this is an early prototype, and I'll be adding more and more levels to this game. I'll take care of this bug once I stop adding new levels.

 

4. What do you mean? At the final pad, doesn't #3 happen?

 

So I take it you don't like the title screen music?

Edited by atari2600land
Link to comment
Share on other sites

1. I've never played Frog Pond. Is there a ROM somewhere for an emulator?

The original prototype can be found here.

 

4. What do you mean? At the final pad, doesn't #3 happen?

On the final pad you can jump up and down rather than being held in place while the counter operates. By jumping up and down you can make it operate more than once.

 

So I take it you don't like the title screen music?

Naw, I'm just picking on you. Your title "Mr. Frog" reminds me of a song taught in basic piano lessons. It's called "Mr. Frog is full of hops" and is incredibly simple to play. (You can see the notes in my previous post.) The words that accompany the song are:

 

"Mis-ter frog is full of hops,

That's be-cause he nev-er stops!

When he leaps he sel-dom flops,

That's be-cause he's full of hops!"

 

I'm sure that a lot of folks around here probably recognize the tune. :)

Link to comment
Share on other sites

Here's Mr. Frog in its present build. I don't know how to do two things:

 

#1: How do I make Mr. Frog not go through walls horizontally and yet stop on them vertically when falling down?

#2: How do I make Mr. Frog not go up walls when pressing the fire button?

 

I've tinkered with the code last night and couldn't come up with anything.

mrfrog012507.bas

Link to comment
Share on other sites

Here's Mr. Frog in its present build. I don't know how to do two things:

 

#1: How do I make Mr. Frog not go through walls horizontally and yet stop on them vertically when falling down?

#2: How do I make Mr. Frog not go up walls when pressing the fire button?

 

I've tinkered with the code last night and couldn't come up with anything.

I kind of like that Mr. Frog can stick to the walls, although it might be good to have his shape change to be vertical instead of horizontal when he's sticking to a wall-- although I'm not sure how you could determine which direction he should be facing in.

 

The only thing I can think of as far as preventing him from clinging to a wall is to draw the wall (or at least part of it) with the ball instead of the playfield, and then not let him cling to the ball. You could do that with only one wall per screen, though.

 

Michael

Link to comment
Share on other sites

The only thing I can think of as far as preventing him from clinging to a wall is to draw the wall (or at least part of it) with the ball instead of the playfield, and then not let him cling to the ball. You could do that with only one wall per screen, though.

Great idea! :) I'll see what I can do with the code I already have.

Link to comment
Share on other sites

There's a much easier way. You've already got the playfield in memory. So just test the rectangle of the player against the pixels he will overlap when he moves along the horizontal and vertical axes. As long as you don't let him move over a playfield pixel either horizontally or vertically, he will be stopped by walls while still being able to stand on top of them.

 

If you want to have him climb walls, you have to be a bit trickier. When you detect a horizontal collision, then you need to change the game mode to a vertical "climbing" sprite that "sticks" to the wall in question. Touching a horizontal surface (vertical collision) would reset this mode. One way of doing this would be to change the frog's gravity depending on the mode. i.e. If he's in a horizontal position, the gravity is normal top-to-bottom. When sticking on the left side of a wall, gravity for the frog would be left-to-right. Clinging on the right side of a wall would be the opposite, right-to-left gravity. :)

Link to comment
Share on other sites

There's a much easier way. You've already got the playfield in memory. So just test the rectangle of the player against the pixels he will overlap when he moves along the horizontal and vertical axes. As long as you don't let him move over a playfield pixel either horizontally or vertically, he will be stopped by walls while still being able to stand on top of them.

Also a great idea! How do I go about doing this?

Link to comment
Share on other sites

Also a great idea! How do I go about doing this?

Here is a link on rectangular collision detection:

 

http://www.gamedev.net/reference/articles/article735.asp

 

It's pretty straightforward stuff. If any of the four points of one rectangle fall inside the other rectangle, you have a collision. The four points are:

 

Top Left:  x, y
  Top Right:  x + width, y
Bottom Left:  x, y + height
Bottom Right:  x + width, y + height

 

The same formula holds true of the playfield pixels. The difference is that playfield pixels are of a fixed size, so it's easy to take the corners and test them against the playfield. All you need to do is remember that the playfield is offset from the left by 4 playfield pixels, each of which is 4 screen pixels wide. The playfield pixels heights are 8 pixels each. Which means you can find the playfield coordinates for X and Y by doing:

 

playfieldx = x-(4*4)/4
playfieldy = y/8

 

Simplifying into runnable code give you:

 

playfieldx = x - 16
playfieldx = playfieldx / 4
playfieldy = y / 8

 

Now that you have playfieldx and playfieldy, you can use the "pfread" function to find if the pixel is on or off. If it's on, you have a collision. If it's off, there's no collision.

Link to comment
Share on other sites

Sorry, I'm not quite getting this. So do I put in variables at the beginning saying "dim playfieldx=q" & "dim playfieldy=p" and then run the code like that? So would I just delete the if(collision) parts and just have this code? Plus, Mr. Frog starts with a collision (he's on the ground when the game starts.)

Link to comment
Share on other sites

This isn't straight-up code you can use. It's just example code to explain how it works. Giving you a full-up implementation would take too much time. More than I have, I'm afraid. :(

 

A simplified explanation of the above is that you need to know what corner of the frog is on what playfield pixel. You do that by taking the X and Y of each corner and dividing it by the width and height (respectively) of the pfpixels.With that information, you can decide whether or not to commit the frog's movement, or throw it away.

 

Yes, this would replace your existing collision detection. :)

Link to comment
Share on other sites

Argh! Stupid boulder problem! Why isn't line 607 working? player1x (w) should be going right once it's done falling off the first platform, but it's not! By the way, I sped up the game so that once you get past level 1, it goes directly to the level I'm having trouble with the boulders.

Link to comment
Share on other sites

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.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...