Jump to content
IGNORED

GoSub for INTV


atari2600land

Recommended Posts

I like both tunes! Maybe you could keep both - play the adventure-ish ditty for the intro screen and maybe play your original short ditty as an " intermission "between levels for say 10 seconds - and then it's on to the next level. Just an idea...

Edited by timdu
Link to comment
Share on other sites

I decided that since the notes in the game sound "scratchy", that I would make tiny tunes with the music player and have that play instead. I discovered that forcing a tune to play when a tune is going stops the current tune and makes the other tune go, which is nice for say getting the key and then immediately crashing into the seaweed. And be real careful after getting the key in level 15...

Edited by atari2600land
  • Like 1
Link to comment
Share on other sites

Does this sound more "adventurey?"

 

It does, and it sounds more like a march than the other one. (I'm still missing the sub on the title screen. ;) )

 

 

I decided that since the notes in the game sound "scratchy", that I would make tiny tunes with the music player and have that play instead. I discovered that forcing a tune to play when a tune is going stops the current tune and makes the other tune go, which is nice for say getting the key and then immediately crashing into the seaweed. And be real careful after getting the key in level 15...

 

ARGH! Darn those moving seaweed walls! :lol:

 

Great work, it is looking a lot more polished. There are only two things I would recommend:

  • Can you speed up the animation of the turning submarine? Just a tad... perhaps a frame or two. If I flip directions fast, the sub starts moving in the opposite direction before the animation completes. This can give the perception that the turn takes too long, and therefore feel a bit laggy.
  • I think you should pause briefly, perhaps with some flashing, when the submarine dies before resetting it. It seems too abrupt right now.

Other than that, great job! This game is now looking and feeling more and more like a polished, professional game. :)

 

-dZ.

Link to comment
Share on other sites

I decided that since the notes in the game sound "scratchy", that I would make tiny tunes with the music player and have that play instead. I discovered that forcing a tune to play when a tune is going stops the current tune and makes the other tune go, which is nice for say getting the key and then immediately crashing into the seaweed. And be real careful after getting the key in level 15...

I like the new tune - it seems to match the animation of the Octopus on the title screen.

The musical sound effects sound good too.

It might be nice to freeze the game for a second when the walls are changing...

 

Catsfolly

Link to comment
Share on other sites

I added another level. I also noticed when the octopus gets in front of the chest, the blue part of the chest shows the octopus. So I added another sprite, sprite 5, to cover that up and make the blue part yellow. So now I have 6 sprites on the screen.

Edited by atari2600land
Link to comment
Share on other sites

I added another level. I also noticed when the octopus gets in front of the chest, the blue part of the chest shows the octopus. So I added another sprite, sprite 5, to cover that up and make the blue part yellow. So now I have 6 sprites on the screen.

 

When I complete level #16, it gets stuck resetting the level with different background tiles, and the sub always starting on top of the chest, causing it to play the winner jingle.

Edited by DZ-Jay
Link to comment
Share on other sites

Are background cards stuff like the seaweed? Don't they have to be at certain positions like letters on the screen?

Yes, you are correct.

Since the chest doesn't move, if you could live with it only being positionable on card boundaries, then

you could draw it with a background card and save one motion object.

 

Your logic would have to say:

 

If the sub collided with then background, then get the backtab address of the card it collided with.

Read that address - if it's the chest, then the player beats the level.

Otherwise, must be the seaweed - the player loses a chance...

 

If you don't need the motion object for anything else, or you want the freedom to place the chest anywhere you want, then just keep doing it the way you're doing it now...

Edited by catsfolly
Link to comment
Share on other sites

Even more unsolicited advice:

 

Last time we saw the source code, you were duplicating a small chunk of code for every maze:

maze3:	procedure
	WAIT 
	if room=2 then restore room2 : CHESTX=135 : CHESTY=50 : x1=32 : y1=50 : keyhave=1
	print at 0 color 6,"    level three     "
	return
	end

maze4:	procedure
	WAIT 
	if room=3 then restore room3 : CHESTX=100 : CHESTY=32 : x1=122 : y1=80 : keyhave=1
	print at 0 color 6,"     level four     "
	goto premazemain
	return
	end

I submit that you could replace all that duplicated code with a single routine that loads the data for all mazes. The result would be that you would save a lot of space (which we don't really care about), and it would be easier to change the level loading if that became necessary (because there would be only one level loading routine instead of 20-30 duplicate sets to edit).

 

How could you do this?

 

First, since this code is mainly setting up a bunch of variables, make a table with the variable values for each level.

	CONST room_data_size		= 8
	CONST room_size			= 10

room_data:
rem maze 1
	DATA		110,55	 ' CHESTX, CHESTY
	DATA		 32,80	 ' x1,y1
	DATA		  1,11   ' keyhave, keynoisetimer
	DATA		  0,0	 ' keyx, keyy

rem maze 2
	DATA		135,30	 ' CHESTX, CHESTY
	DATA		135,80	 ' x1,y1
	DATA		  1,11   ' keyhave, keynoisetimer
	DATA		  0,0	 ' keyx, keyy

rem maze 3
	DATA		135,50	 ' CHESTX, CHESTY
	DATA		 32,50	 ' x1,y1
	DATA		  1,11   ' keyhave, keynoisetimer
	DATA		  0,0	 ' keyx, keyy

rem maze 4
	DATA		100,32	 ' CHESTX, CHESTY
	DATA		122,80	 ' x1,y1
	DATA		  1,11   ' keyhave, keynoisetimer
	DATA		  0,0	 ' keyx, keyy


rem maze 5
	DATA		130,24	 ' CHESTX, CHESTY
	DATA		 32,80	 ' x1,y1
	DATA		  0, 0   ' keyhave, keynoisetimer
	DATA		 84,30	 ' keyx, keyy

rem maze 6
	DATA		 60,55	 ' CHESTX, CHESTY
	DATA		 32,80	 ' x1,y1
	DATA		  0, 0   ' keyhave, keynoisetimer
	DATA		130,55	 ' keyx, keyy

..etc

Then you could replace all the maze1-mazeN code blocks with a single subroutine:

load_room: PROCEDURE
	rem set up the variables
	#index			= room_data_size * room
	CHESTX			= room_data(#index)
	CHESTY			= room_data(#index+1)
	x1			= room_data(#index+2)
	y1			= room_data(#index+3)

	keyhave			= room_data(#index+4)
	keynoisetimer	= room_data(#index+5)
	keyx			= room_data(#index+6)
	keyy			= room_data(#index+7)

	rem draw the maze
	#index = room * room_size
	 print color 5
        for y=1 to 10
          #line = room0(#index+y-1)
           for x=0 to 19
             if #line and $8000 then print at y*20+x+2,"\272"
             #line = #line * 2
           next 
        next
	
        return
	end

I took out the code to draw the level, so that would have to be another routine:

rem print at values for each level title
level_title_pos:
	DATA 5,5,4,5,5
	DATA 5,4,4,5,5
	DATA 3,3,3,3,3 ' these values need adjusting
	DATA 3,3,3,3,3 ' these values too

print_level: PROCEDURE
	print at level_title_pos(room) COLOR 6, "level "
	if (room=0) then print "one"
	if (room=1) then print "two"
	if (room=2) then print "three"
	if (room=3) then print "four"
	if (room=4) then print "five"

	if (room=5) then print "six"
	if (room=6) then print "seven"
	if (room=7) then print "eight"
	if (room= then print "nine"
	if (room=9) then print "ten"

	if (room=10) then print "eleven"
	if (room=11) then print "twelve"
	if (room=12) then print "thirteen"
	if (room=13) then print "fourteen"
	if (room=14) then print "fifteen"

	if (room=15) then print "sixteen"
	if (room=16) then print "seventeen"
	if (room=17) then print "eighteen"
	if (room=18) then print "nineteen"
	if (room=19) then print "twenty"
	RETURN
	END


So "newmaze2" would become:

newmaze2:
	dir=0	
	subtimer=0
	#lives=#lives-1

	cls
	sound 0,,0 

    SPRITE 0,0,0
    SPRITE 1,0,0
	SPRITE 2,0,0
	SPRITE 3,0,0
	SPRITE 4,0,0

	gosub load_room
	gosub print_level
	
premazemain:

	octox=82 : octoy=42 : turn=0 : dirr=1
	shapeget=0 : shapeget2=0 
	if room=4 then octox=100
	if room=6 then octox=100
        if room=11 then octox=30


Edited by catsfolly
  • Like 4
Link to comment
Share on other sites

Wow, it's been too many years. What does "restore" really do in IntyBASIC? I remember using it in the Commodore days as a pointer clear when doing READs and such. But then I see this:

 

if room=2 then restore room2 : CHESTX=135 : CHESTY=50 : x1=32 : y1=50 : keyhave=1

 

"restore room2"? What is this doing?

 

 

Slick re-write, by the way. I can't wait to begin clobbering array pointers once I get into something more complex. :D

Link to comment
Share on other sites

Wow, it's been too many years. What does "restore" really do in IntyBASIC? I remember using it in the Commodore days as a pointer clear when doing READs and such. But then I see this:

 

if room=2 then restore room2 : CHESTX=135 : CHESTY=50 : x1=32 : y1=50 : keyhave=1

 

"restore room2"? What is this doing?

 

 

Slick re-write, by the way. I can't wait to begin clobbering array pointers once I get into something more complex. :D

The "RESTORE" command sets up an address for the "READ" command to read words from.

"restore room2 sets the read address to "room2". The next read command will return the first word at room2:

Then the next read command will return the second word (at room2 +1). Etc.

 

Before Nanochess put in arrays, this was the only way to read a table of data in IntyBasic (well, other than using peeks),

  • Like 1
Link to comment
Share on other sites

Cool. I'm glad the "single level loading procedure" idea worked out for you.

 

When writing IntyBasic code, I tend to put the main routines at the beginning of the file, and put the data and procedures at the end.

That way, Someone looking at the code can see the main routines as a kind of outline.

 

For example, a person looking at the code sees a call to a procedure to draw the tile screen. If they are interested in how that is done, they can find the procedure and examine it, otherwise they can continue to follow the main routine and see what it does next.

 

Currently, in Gosub the procedures are put right in the middle of the main routine, and the code in the main routine has to jump around them to keep going. Since these procedures are called with the gosub command, they don't need to be inside the main routine.

 

That's how I do it.

 

Catsfolly

Edited by catsfolly
Link to comment
Share on other sites

I like this game a lot. Simple yet challenging. (I have gosub and gosub 2 on the O2). I have 1 small suggestion. Can you add a way to jump directly to a specific level or choose the starting level. either way, I am looking foward to the games completion and getting it in cartridge form.

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