Jump to content
IGNORED

Example Program: Shoot Missile in 8 Directions


Random Terrain

Recommended Posts

Example Program: Shoot Missile in 8 Directions

 

By Duane Alan Hahn (Random Terrain) using hints, tips, and code snippets from AtariAge members such as batari, SeaGtGruff, RevEng, Robert M, Atarius Maximus, and jrok.

 

 

About this program:

 

I might turn this into a real game and possibly call it Seaweed Patrol if I don't think of a better name.

 

You are part of an advanced underwater civilization. Everyone has a job and yours is to patrol your section of the ocean in a semi-organic submarine. Highly aggressive seaweed surrounds you and it keeps trying to replicate faster than you can shoot. Use your missiles to blast any bits of seaweed that appear before they clog up your sector and spread to others, making it nearly impossible for anyone to travel. Don't let the seaweed strangle your civilization to extinction.

 

Your ship will be damaged if you bump into the seaweed, so be careful.

 

If I turn this into a game, there will be an enemy or two and bonus items to collect. I'll also have to figure out if it's a non-stop game or if there will be rounds.

 

Hit the reset switch if you want to restart the program.

 

 

 

This is the first draft. I still need to add variable descriptions and probably a few more comments too. I'll do that later today or tonight. Remember, this is not a complete game. There is no title screen, no bonus items, no enemy sprite, and the difficulty doesn't increase yet (it's pretty much on the easiest setting).

 

 

First draft

 

Here's the .bin file to use with an emulator or a real Atari using the Harmony cartridge:

ex_shoot_missile_2010y_08m_27d_0251t.bin

 

Here's the .bas file if you want to look at the code:

ex_shoot_missile_2010y_08m_27d_0251t.bas

 

 

There are probably ways to crunch the code down that I don't know about yet. If anybody who is good at that can point out where I might be able to save hundreds or thousands of bytes, I would appreciate it. I don't want to put this on the bB page until it is as perfect as we can get it.

 

I'll add future drafts to this first post. If nothing unexpected happens, the second draft will be posted later today or tonight.

 

Thanks.

 

 

Update: I just had an idea. Since you can shoot more than one piece of seaweed with one missile, it might be possible to have the first hit be worth 10 points, the second hit 20, the third hit 40, the fourth hit 80, and so on. The player would be more likely to wait until a nice row is lined up before shooting and it would be kind of satisfying.

Edited by Random Terrain
  • Like 2
Link to comment
Share on other sites

I dug through the code a bit, and everything looks efficient to me. Its probably the easiest to read bB source code I've ever seen!

 

I like what you've done so far, and I'd love to see it turned into a full game. The sliding effect is a nice touch, and multiplied scores for lining up the targets would make for a interesting bit of strategy.

Link to comment
Share on other sites

I've always been confident you're capable of finishing some pretty decent games.

 

This one is simple and fun. I like the story line and how you wrote it. I like your idea about the first hit worth XX, the second worth XX, etc.

 

I think this might be fun as a "Berzerk" or "Smash TV" like game.. block off the top and bottom. You are required to stay on the screen and clean up so much before you can exit the level.

 

I like the sliding a lot. I've always wanted to add that to a game.

 

Finish up whatever needs to be finished, modify RevEng's title screen so that you can use it in a few banks.. this way you can have an animated title screen. Bam.. your first finished game on cartridge.. :D I'll display it at my table at the Video Game Trader Expo in October if you want. :)

 

For my own stuff I got a price on boxes if we want to do like 20 copies. Maybe those 20 copies can all be printed differently to give them some sort of randomness to it.

Edited by yuppicide
Link to comment
Share on other sites

I'm interested in the advanced joystick reading code. Reading SWCHA and on goto/gosub seems to be the way to go. Comments are nice. The asterix's makes them stand out and are much more readable.

My emulator doesn't seem to want to continue going diagonal. I get the inital keypress in and then it veers straight north or south. My guess is that Keyboards Are Evil.

Edited by theloon
Link to comment
Share on other sites

Thanks for the replies. Yeah, if the code can't be crunched that much, next step is bank switching. First thing is to add variable descriptions and a few more comments tonight, then I can see what I can do to turn this into a game.

Edited by Random Terrain
Link to comment
Share on other sites

Ugh, I can't make much of this in terms of adding it to my own code. There's too much extra where as I just need to know how to shoot from an animation in only 2 directions and how to move using an animation. But I don't need to have a diagonal animation, just the normal walk.

Edited by endrien
Link to comment
Share on other sites

How would one go about adding a title screen to this?...

If you mean one that uses the new titlescreen kernel (instead of using the kernel's playfield to draw a title) then a tutorial for that should be forthcoming in a few weeks. Hold tight.

 

I mean one like I already have made, that works in my own code but not this example. Like I said, this example seems to over complicate some things, it's like signing up for a math class but instead of teaching you just math the teacher decides to teach math, physics, biology and english. In this case, your going in expecting to learn how to shoot in 8 directions, instead it trys to teach you how to shoot in 8 directions while animating 8 directions while sliding with a health bar, score, objects to hit etc.

 

titlescreen

COLUBK=14
pfcolors:
$00
$F4
$42
$42
$42
$42
$00
$30
$30
$00
$00
end
playfield:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
................................
.XXXX..X.......X...X...X........
...X..X....X......X...X.......X.
..X..XXX..X.X..X.X...X...XX..X.X
.X..X..X.X....X..XX..XX.X...X...
................................
.XXXXXXXXXXXXXXXXX..............
..................XXXXXXXXXXXXX.
................................
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end

drawscreen

if joy0fire then goto main

goto titlescreen

Edited by endrien
Link to comment
Share on other sites

Like I said, this example seems to over complicate some things, it's like signing up for a math class but instead of teaching you just math the teacher decides to teach math, physics, biology and english.

I see what you mean, though I know RT intended this to be a more integrated example, rather than the short (and difficult to mix) examples in the code snipplets thread.

 

And to be fair, you are asking for him to integrate yet another feature into his program - a titlescreen. ;)

 

Maybe if he called it something like "Advanced Example: A game with missile shooting in 8 directions" your expectations would have matched the example better.

Link to comment
Share on other sites

Like I said, this example seems to over complicate some things, it's like signing up for a math class but instead of teaching you just math the teacher decides to teach math, physics, biology and english.

I see what you mean, though I know RT intended this to be a more integrated example, rather than the short (and difficult to mix) examples in the code snipplets thread.

 

And to be fair, you are asking for him to integrate yet another feature into his program - a titlescreen. ;)

 

Maybe if he called it something like "Advanced Example: A game with missile shooting in 8 directions" your expectations would have matched the example better.

 

 

:P I was just asking where I could add a title screen in the code as I already had one made, though I looked at the simpler code snippet and based my code off that to create a animated moving shooting character.

Link to comment
Share on other sites

Like I said, this example seems to over complicate some things, it's like signing up for a math class but instead of teaching you just math the teacher decides to teach math, physics, biology and english. In this case, your going in expecting to learn how to shoot in 8 directions, instead it trys to teach you how to shoot in 8 directions while animating 8 directions while sliding with a health bar, score, objects to hit etc.

Like I said in another thread, I'm going to make smaller examples too. You seemed to be ready for an all-in-one example program, so I threw in missiles, animation, simplistic sounds, and so on.

 

Instead of working on the second draft tonight, I have another example program I can adapt to simply shoot missiles. Do you want me to use Advanced Joystick Reading with SWCHA or do you want if-thens with joy0up, joy0down, and so on?

Link to comment
Share on other sites

Like I said, this example seems to over complicate some things, it's like signing up for a math class but instead of teaching you just math the teacher decides to teach math, physics, biology and english. In this case, your going in expecting to learn how to shoot in 8 directions, instead it trys to teach you how to shoot in 8 directions while animating 8 directions while sliding with a health bar, score, objects to hit etc.

Like I said in another thread, I'm going to make smaller examples too. You seemed to be ready for an all-in-one example program, so I threw in missiles, animation, simplistic sounds, and so on.

 

Instead of working on the second draft tonight, I have another example program I can adapt to simply shoot missiles. Do you want me to use Advanced Joystick Reading with SWCHA or do you want if-thens with joy0up, joy0down, and so on?

Joy0up etc seem to work well. I got the missile shooting and character movement working using the snippets. I thought I was ready to get it all at once but I hadn't realized how much it would actually be as what you made is pretty much a full game.

What I need to get working now is collision detection(which I've yet to take a look at the snippet, so I need to do that) and enemies that chase you. After that I'll need to figure out how to add playfield obstacles.

 

Also, this thread deserves a sticky .

Edited by endrien
Link to comment
Share on other sites

Since my first try at a large example program was a failure, I'm going to turn it into a game without worrying about using it as an example program. I'll make a new thread about it when I'm done upgrading it to bank switching.

 

Before I can make a new thread, I need to know the name of the game. Here are two possible names:

 

Seaweed Patrol

 

Seaweed Assault

 

 

Which do you think sounds better? I'm leaning towards Seaweed Assault.

Link to comment
Share on other sites

Since my first try at a large example program was a failure, I'm going to turn it into a game without worrying about using it as an example program. I'll make a new thread about it when I'm done upgrading it to bank switching.

 

Before I can make a new thread, I need to know the name of the game. Here are two possible names:

 

Seaweed Patrol

 

Seaweed Assault

 

 

Which do you think sounds better? I'm leaning towards Seaweed Assault.

I agree; "Seaweed Assault" sounds better.

 

And if you need a name for the ship, may I suggest "The Manatee"?

 

Again, looking forward to this one.

Link to comment
Share on other sites

I agree; "Seaweed Assault" sounds better.

 

And if you need a name for the ship, may I suggest "The Manatee"?

 

Again, looking forward to this one.

Thanks. I had to work on the bB page for a few days, but now I can split my time between this program and updating the VbB page for a while.

 

I converted to bank switching, so the program is now 16k. I fixed a few problems and figured out a better way to debounce. The ending is different now. The seaweed overtakes the screen at the end.

 

Looks like this will be the first game I'll actually finish.

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