Jump to content

Photo

Example Program: Shoot Missile in 8 Directions


18 replies to this topic

#1 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 24,846 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Aug 27, 2010 12:45 AM

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:
Attached File  ex_shoot_missile_2010y_08m_27d_0251t.bin   4KB   183 downloads

Here's the .bas file if you want to look at the code:
Attached File  ex_shoot_missile_2010y_08m_27d_0251t.bas   30.13KB   224 downloads


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, Fri Aug 27, 2010 9:37 PM.


#2 RevEng OFFLINE  

RevEng

    River Patroller

  • 3,309 posts
  • bit player
  • Location:Canada

Posted Fri Aug 27, 2010 7:35 AM

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.

#3 yuppicide OFFLINE  

yuppicide

    I am the Black Knight. Give me your money!

  • 6,933 posts
  • Location:New Jersey

Posted Fri Aug 27, 2010 8:12 AM

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, Fri Aug 27, 2010 8:17 AM.


#4 theloon OFFLINE  

theloon

    Quadrunner

  • 7,702 posts

Posted Fri Aug 27, 2010 10:05 AM

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, Fri Aug 27, 2010 10:06 AM.


#5 endrien OFFLINE  

endrien

    Chopper Commander

  • 183 posts

Posted Fri Aug 27, 2010 1:39 PM

Thanks a ton for this, I'm going to see what I can get accomplished using this tonight.

#6 pitfall_jerry OFFLINE  

pitfall_jerry

    Space Invader

  • 37 posts
  • Location:Atlanta, GA

Posted Fri Aug 27, 2010 1:49 PM

I can't wait to get my system back up to see how it works. Thanks!

#7 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,846 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Aug 27, 2010 2:08 PM

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, Fri Aug 27, 2010 2:16 PM.


#8 endrien OFFLINE  

endrien

    Chopper Commander

  • 183 posts

Posted Fri Aug 27, 2010 3:52 PM

How would one go about adding a title screen to this? And removing the sliding?

Edited by endrien, Fri Aug 27, 2010 3:57 PM.


#9 Christophero Sly OFFLINE  

Christophero Sly

    River Patroller

  • 4,823 posts

Posted Fri Aug 27, 2010 4:08 PM

This is actually the first bB program I've played with (I don't do emulators). I'm impressed. It reminds me of Turmoil, Ram It, and Squeeze Box, but the free roaming nature w/ diagonal movement really opens up that style of gameplay. I look forward to seeing where you take this.

#10 endrien OFFLINE  

endrien

    Chopper Commander

  • 183 posts

Posted Fri Aug 27, 2010 4:15 PM

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, Fri Aug 27, 2010 4:17 PM.


#11 RevEng OFFLINE  

RevEng

    River Patroller

  • 3,309 posts
  • bit player
  • Location:Canada

Posted Fri Aug 27, 2010 4:20 PM

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.

#12 endrien OFFLINE  

endrien

    Chopper Commander

  • 183 posts

Posted Fri Aug 27, 2010 4:21 PM


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, Fri Aug 27, 2010 4:25 PM.


#13 RevEng OFFLINE  

RevEng

    River Patroller

  • 3,309 posts
  • bit player
  • Location:Canada

Posted Fri Aug 27, 2010 6:37 PM

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.

#14 endrien OFFLINE  

endrien

    Chopper Commander

  • 183 posts

Posted Fri Aug 27, 2010 6:54 PM

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.

#15 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,846 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Aug 27, 2010 9:13 PM

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?

#16 endrien OFFLINE  

endrien

    Chopper Commander

  • 183 posts

Posted Fri Aug 27, 2010 9:43 PM

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, Sat Aug 28, 2010 4:08 AM.


#17 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,846 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Thu Sep 2, 2010 1:48 PM

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.

#18 Christophero Sly OFFLINE  

Christophero Sly

    River Patroller

  • 4,823 posts

Posted Sun Sep 5, 2010 4:38 PM

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.

#19 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • Topic Starter
  • 24,846 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Sep 5, 2010 5:17 PM

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.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users