Jump to content
IGNORED

Tunnels Of Zeta (was Scrolled PF Colors Out Of Sync)


MausGames

Recommended Posts

Edit : RT fixed this problem, but I will keep updating this thread as the game progresses.

 

I know my code for scrolling the playfield colors is completely wrong, but I'm not sure how to make it work correctly. Can anyone help?

tz1.zip

post-9377-1210479753_thumb.png

 

I guess I also need to figure out why the playfield isn't scrolling the playfield the same number of times when you reach the top or bottom of the screen. There are still quite a few bugs actually...

Edited by MausGames
Link to comment
Share on other sites

Color scrolling is a bit tricky... I had some problems with it... the scrollposition sometimes is off, and you have to compensate for it another way. I will look at your code and see what I can do for you. It's late tonight, though, and I'm very tired, so it will have to wait until tomorrow or Monday. In the meantime, check out my code for Arctic Landtran and see if it helps you any.... It uses color scrolling similar to what you are looking for in your game....

Link to comment
Share on other sites

I use a similar method, but the reason I'm having problems is because my playfield scrolls in both directions. Thanks for the offer, hopefully you can do something with it that I haven't been able to.

 

I know that batari has said that using a missile for collision detection is a shameful waste of resources, but my attempts to use pfread instead in the project completely failed. I still have player1, a missile, and a ball to work with, and I'm going to keep this really simple, don't want to spend more than a few more hours on it.

Edited by MausGames
Link to comment
Share on other sites

I just recently figured out how to successfully scroll playfield pixels along with the row colors. I did it scrolling up and scrolling down, but I haven't tried scrolling up and scrolling down in the same program. I assume it could be done, but the only way to know for sure is to try.

Link to comment
Share on other sites

I just recently figured out how to successfully scroll playfield pixels along with the row colors. I did it scrolling up and scrolling down, but I haven't tried scrolling up and scrolling down in the same program. I assume it could be done, but the only way to know for sure is to try.

 

I haven't been able to get it to work right in both directions, but only one took a few tries. This was originally a kernel kind of similar to Falldown, but I wanted to try to create something more similar to the original Metroid.

Link to comment
Share on other sites

I just recently figured out how to successfully scroll playfield pixels along with the row colors. I did it scrolling up and scrolling down, but I haven't tried scrolling up and scrolling down in the same program. I assume it could be done, but the only way to know for sure is to try.

 

I haven't been able to get it to work right in both directions, but only one took a few tries. This was originally a kernel kind of similar to Falldown, but I wanted to try to create something more similar to the original Metroid.

I'm playing around with the code to see if I can help, but first I need to know if you want that top part to be brown.

Link to comment
Share on other sites

I tried what lord_mike posted since it's probably a better way than what I figured out, but I couldn't get it to work right, so I just fixed it using what I can understand. This seems to scroll up and down without a problem:

 

tz1_2008y_05m_13d_0533t_fixed.bin

tz1_2008y_05m_13d_0533t_fixed.bas

 

I took out the two barriers you had on the screen so I could move the guy around easier. I added the variable P since it seemed to be free, changed your color code a bit, and added two subroutines. Here are the lines that I changed:

 

Added p=3:

   s = 50 : t = 0 : a = 10 : d = 1 : e = 2 : b = 0 : p=3

 

 

These lines were deleted:

  if c = 8 then gosub colors1
 if c = 16 then gosub colors2
 if c = 24 then gosub colors3
 if c = 24 then c = 0
 if g = 1 then gosub colors1
 if g = 9 then gosub colors3
 if g = 17 then gosub colors2
 if g = 24 then g = 0

 

 

I added gosub cscroll and gosub gscroll:

  if w > 0 && player0y > 48 then g = 0 : w = w + 1 : c = c + 1 : gosub cscroll : pfscroll up : player0y = player0y - 2 : goto main
 if w > 0 && player0y < 48 then c = 0 : t = 0 : w = w + 1 : g = g + 1 : gosub gscroll : pfscroll down : goto main

 

New subroutines:

cscroll
  if playfieldpos=1 then p=p-1 : if p<1 then p=3
  if playfieldpos=1 then on p goto colors1 colors1 colors2 colors3
  return

gscroll
  if playfieldpos=8 then p=p+1 : if p>3 then p=1
  if playfieldpos=8 then on p goto colors1 colors1 colors2 colors3
  return

 

 

Adjusted the colors:

colors1
  pfcolors:
  228
  40
  42
  228
  40
  42
  228
  40
  42
  228
  40
  42
end
  return

colors2
  pfcolors:
  42
  228
  40
  42
  228
  40
  42
  228
  40
  42
  228
  40
end
  return

colors3
  pfcolors:
  40
  42
  228
  40
  42
  228
  40
  42
  228
  40
  42
  228
end
  return

Link to comment
Share on other sites

Thanks RT, I believe that is the first bidirectional scrolling routine with a multicolored playfield. Now that I have that, and a routine to read level data from tables, I'm going to rewrite the collision code to use pfread instead of a strobed missile. There has to be a way to make it work, I need that missile. Since most of this code was written for a forced-scrolling kernel with constantly changing playfieldpos values, it really doesn't fit the new bi-directional kernel. I've also adjusted the code so that playfpieldpos always resets after a scroll and the player never goes through the playfield during scrolling, and added weapon fire. I'll post the reworked bas/bin later tonight.

 

Here is a blank template for the levels, they are pretty large and each use 3 full data tables, with 32 possible configurations for each green line of playfield, and 16 for the brown ones. I can also do horizontal rooms and tunnels that branch off of the sides of the main vertical tunnel - with doors or "portals", similar to Metroid.

 

post-9377-1210713666_thumb.png

Edited by MausGames
Link to comment
Share on other sites

I got the flu pretty bad, so it's been hard to work on this. I'm trying to rewrite it all at once to be efficient, clean, and hopefully leave more variables free. Here are 16 of the 32 possible playfield rows for the green lines. I don't think the brown lines will be used for platforms, only for walls. I also attached a mockup of a possible room branching off of the tunnel.

post-9377-1210818747_thumb.png post-9377-1210818754_thumb.png

Link to comment
Share on other sites

I've started over from scratch and this time used 'pfread' for collision detection. That means I have two missiles and the player1 sprite left to use. The ball has been used for weapon fire. You can only fire one shot at a time, to save variables and increase the maximum number of enemies on screen.

 

The playfield collision detection isn't perfect, but I like it. It seems like it works about the same or a little better than using the missile, but it's a lot of confusing code and took more cycles than I thought it would.

 

The controls are mostly finished. You can duck, fire, duck & fire, duck & slide, fire up, fly, and place bombs. The bomb code isn't finished, will do that now.

 

Next up is adding the data for the first level and the code to read and display it. That should be pretty easy and straight-forward, but I could be wrong - especially with bidirectional scrolling. Hopefully it only takes a few variables.

 

Any questions/suggestions?

TZbeta1.bas

TZbeta1.bin

Edited by MausGames
Link to comment
Share on other sites

Hi Maus

You are such a great programmer.It would be great to see a finished game.

greetings Walter

 

Thank you, glad you like it so far. I agree it'd be nice to see this as a finished game. I'm not sure if it would be fun though, it's more for practice than anything. Every time I program different game elements I get a little better at it, maybe someday that will add up to having the skill to finish a good game.

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...