Jump to content



1

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


14 replies to this topic

#1 MausGames OFFLINE  

MausGames

    Dragonstomper

  • 851 posts
  • Location:MO, USA

Posted Sat May 10, 2008 10:21 PM

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?
Attached File  tz1.zip   3.94K   30 downloads
tz1.gif

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, Wed May 14, 2008 8:42 PM.


#2 lord_mike OFFLINE  

lord_mike

    Chopper Commander

  • 161 posts

Posted Sat May 10, 2008 10:39 PM

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

#3 MausGames OFFLINE  

MausGames

    Dragonstomper

  • 851 posts
  • Location:MO, USA

Posted Sun May 11, 2008 1:59 AM

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, Sun May 11, 2008 2:01 AM.


#4 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 20,911 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun May 11, 2008 6:05 AM

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.

#5 MausGames OFFLINE  

MausGames

    Dragonstomper

  • 851 posts
  • Location:MO, USA

Posted Sun May 11, 2008 1:10 PM

View PostRandom Terrain, on Sun May 11, 2008 7:05 AM, said:

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.

#6 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 20,911 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun May 11, 2008 3:36 PM

View PostMausGames, on Sun May 11, 2008 3:10 PM, said:

View PostRandom Terrain, on Sun May 11, 2008 7:05 AM, said:

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.

#7 MausGames OFFLINE  

MausGames

    Dragonstomper

  • 851 posts
  • Location:MO, USA

Posted Sun May 11, 2008 5:40 PM

The brown line is set by COLUPF, and yes it can stay that way for now. It isn't essential, that is just the color I set the playfield register, so I can see playfieldpos for the topmost row.

Edited by MausGames, Sun May 11, 2008 5:41 PM.


#8 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 20,911 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Tue May 13, 2008 4:07 AM

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:

Attached File  tz1_2008y_05m_13d_0533t_fixed.bin   8K   40 downloads
Attached File  tz1_2008y_05m_13d_0533t_fixed.bas   7.78K   29 downloads

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


#9 MausGames OFFLINE  

MausGames

    Dragonstomper

  • 851 posts
  • Location:MO, USA

Posted Tue May 13, 2008 3:21 PM

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.

tztemplate1.gif

Edited by MausGames, Tue May 13, 2008 3:29 PM.


#10 MausGames OFFLINE  

MausGames

    Dragonstomper

  • 851 posts
  • Location:MO, USA

Posted Wed May 14, 2008 8:33 PM

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.
tz2.gif tz3.gif

#11 gambler172 OFFLINE  

gambler172

    River Patroller

  • 2,060 posts
  • none
  • Location:germany

Posted Sat May 17, 2008 10:21 AM

Hi Maus
You are such a great programmer.It would be great to see a finished game.
greetings Walter

#12 MausGames OFFLINE  

MausGames

    Dragonstomper

  • 851 posts
  • Location:MO, USA

Posted Tue May 20, 2008 9:03 PM

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?

Attached Files


Edited by MausGames, Tue May 20, 2008 9:13 PM.


#13 MausGames OFFLINE  

MausGames

    Dragonstomper

  • 851 posts
  • Location:MO, USA

Posted Tue May 20, 2008 9:17 PM

View Postgambler172, on Sat May 17, 2008 11:21 AM, said:

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.

#14 lord_mike OFFLINE  

lord_mike

    Chopper Commander

  • 161 posts

Posted Tue May 20, 2008 10:51 PM

View PostMausGames, on Tue May 20, 2008 11:03 PM, said:

Any questions/suggestions?

Nah, looking sweet so far, man! :)

#15 gambler172 OFFLINE  

gambler172

    River Patroller

  • 2,060 posts
  • none
  • Location:germany

Posted Sun May 25, 2008 2:30 AM

Hi Maus
The actual version looks really great.Cannot wait to see a first working level.How about adding some enemies?
greetings Walter




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users