Jump to content
IGNORED

Total noob here, please help.


arcade_lights

Recommended Posts

Ok, so I've never had anything to do with programming in my life. However I love Atari 2600 like everyone here and I have a great idea for a game. I've been reading this forum and random terrain site for days now, my eyes and head are about to burst, but this whole programming terminology is mostly completely foreign to me. Nevertheless, I was able to actually grasp some things. I made these two guys move left and right and I was also able to create a title screen. I'm actually proud of this, given my complete lack of knowledge. Here they are.

 

 

 

So, what do I need;

 

1. Merge the title screen with my game. Tried several commands, non of which worked. Like these for example:

 

bank 2
asm
include "titlescreen/asm/titlescreen.asm"
titlepage
gosub titledrawscreen bank2
if joy0fire || switchreset then goto gamestart
goto titlepage

 

 

 

2. Make the cop move a little faster, like the buckets in Kaboom.

 

3. Multicolored playfield. The two lines should be in colors of two different flags. I tried pfcolor command but got an error.

 

4. Include the third sprite below the lower playfield line and repeat it 6 times. They are supposed to be motionless. And disappear if hit by a rock.

 

5. Make the upper rioter guy randomly throw rocks, or balls, whatever, like the Kaboom guy.

 

6. Possibly multicolored sprites, but this is not crucial.

 

7. Also, animated sprites with moving legs, I can'f figure out the sprite animator.

 

I know I'm asking too much, but I also love Atari too much :) so I guess you guys understand. Any kind of help is highly appreciated. Thanx in advance.

 

And I apologize if this is in the wrong forum, I guess I should have posted in 2600 programming for newbies.

Edited by arcade_lights
Link to comment
Share on other sites

I've tried it, but it gives me an error when I try to compile it. Where should I exactly insert this command? Here's my whole code:

 

 playfield:
 ................................
 ................................
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 ................................
 ................................
 ................................
 ................................
 ................................
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 ................................
 ................................
end


 COLUBK=$D6
 COLUPF=$34


 player0x=80:player0y=64
 player1x=15:player1y=16


 player0color:
 $9A
 $9A
 $9A
 $FE
 $FE
 $8A
 $FE
 $06
end


 player0:
 %00100010
 %00011100
 %00011100
 %00001010
 %00111000
 %01111110
 %00001000
 %11111111
end


 player1color:
 $88
 $88
 $8A
 $06
 $06
 $06
 $FE
 $FE
end


 player1:
 %00100100
 %00100100
 %00011000
 %00011000
 %00111100
 %01111110
 %01011010
 %00011000
end


draw_loop


 COLUP0=$86
 COLUP1=$04
 scorecolor=$1C 
 drawscreen


 if joy0left then player0x=player0x-1
 if joy0right then player0x=player0x+1
 if joy1left then player1x=player1x-1
 if joy1right then player1x=player1x+1


 goto draw_loop
Link to comment
Share on other sites

 

I've tried it, but it gives me an error when I try to compile it. Where should I exactly insert this command? Here's my whole code:

 

 

First of all welcome to Atari Age and congratulations making your first program, well done! Yes you

 

will need a secondary loop that is outside the main_loop(drawloop) to add a title_screen; the asm code must not be inside the main_loop (intermediate user level). As for extra sprites you need to use a multisprite kernel or DPC+ however keep in mind any additional are repositioned player1 virtual sprites.

 

Personally i strongly suggest making a couple of test programs to learn some of the kernels and how to bankswitch, labels, collision detection ect ect. Test programs can make useful templates and give a decluttered view of how they work.

 

Also RT's site is extremely helpful and i always have the batari Basic commands guide open in the background when coding in bB.

Edited by Tony The 2600
  • Like 1
Link to comment
Share on other sites

I am half new myself. I will make a suggestion but don't take my word for it lol I have a few things to learn myself. BUT, in my games this is how it works for now.
I let the title screen loop, and if you press fire button you then go into the game. Fill in the code as you need, i'll leave it empty. Maybe it will help.

titleScreen


(fill in your title screen code here)
Ex:

 COLUBK=$00
 COLUPF=$00

 pfheights: 
 8
 8
 8
 8
 8
 8
 8
 8
 8
 8
 8
end

 playfield:
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
end

  if joy0fire then goto startEngine   

   drawscreen 

      goto titleScreen

startEngine


       (build game code here.)

 return thisbank




Edited by WizardBone
Link to comment
Share on other sites

Hey guys, I've been working really hard on this for days now. I would like to hear your suggestions. I used rand command on player1x to make it look like there's lots of them rioting, but I would like to slow them down a little bit. Also, I created taser from a missle0 for a cop, The dark grey squares are trash cans in the middle of the street. So, the rioters are running around and kicking trashcans and the player0 is supposed to catch them. I don't know how to make those trash cans fall in a random manner, I guess it's a pfscroll command right? I tried but couldn't figure it out. When all trash cans are gone, rioters charge towards the cop and he uses his taser on them and the whole cycle repeats, but faster.. I know how to program this afterwards. Also, I still didn't figure out how to use sound. There should be typical atari throbbing sound which is supposed to be rioters yelling, electric sound for the taser and catching sound for the trash cans. Any suggestions are welcome. Here's the whole code so feel free to suggest anything. Thanx in advance.

 

set kernel_options player1colors


 set kernel_options pfcolors: 


 drawscreen 


 pfcolors:
 $0E
 $44
 $0E
 $02
 $0E
 $44
 $0E
 $1E
 $0E
 $5E
 $5E
end


 playfield:
 ...............X................
 ................................
 ...............X................
 X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.
 ...............X................
 ................................
 ...............X................
 ................................
 ................................
 .X...X...X...X...X...X...X...X..
 XXX.XXX.XXX.XXX.XXX.XXX.XXX.XXX.
end


 COLUBK = $06


 player0x=80:player0y=71
 player1x=15:player1y=24








 player0color:
 $9A
 $9A
 $9A
 $9A
 $9A
 $9A
 $9A
 $9A
end


 player0:
 %11000011
 %01000010
 %00111100
 %00111100
 %11111111
 %10011001
 %00011000
 %00111100
end


 player1color:
 $00
 $88
 $8A
 $00
 $00
 $00
 $FE
 $FE
end




 player1:
 %01100110
 %00100100
 %00011000
 %00011000
 %00111100
 %01111110
 %01011010
 %00011000
end




draw_loop
 drawscreen


  pfcolors:
 $0E
 $44
 $0E
 $02
 $0E
 $44
 $0E
 $1E
 $0E
 $5E
 $5E
end




 COLUP0 = $94
 lives = 96 
 lifecolor = $94
  lives:
   %00000000
   %11111110
   %11111110
   %11111110
   %11111110
   %11111110
   %00000000
   %00000000
end






 scorecolor = $42


 if joy0left then player0x = player0x-3
 if joy0right then player0x = player0x +3


 player1x = (rand&63) + (rand&31) + (rand&15) + (rand&1) + 21
 player1y = (rand/8)




 if player0x < 14 then player0x = 14
 if player0x > 139 then player0x = 139


 if player1x < 14 then player1x = 14
 if player1x > 139 then player1x = 139




 NUSIZ0 = 0


 missile0y = 222
 missile0height = 30


 missile0y = missile0y - 6


 if joy0fire then missile0y=player0y-5:missile0x=player0x+8


 if collision(missile0,player1) then score=score+10
 if collision(player0,playfield) then score=score+5




 goto draw_loop
Link to comment
Share on other sites

Nice project you have there, well i strongly advise learning about variables (reading, writing and defining variables). Any sort of game logic needs to use variables and what you're looking for in this case is a simple counter.

 

So rather then this:

 player1x = (rand&63) + (rand&31) + (rand&15) + (rand&1) + 21
 player1y = (rand/8) 

Rewrite to something like this:

 a = a + 1
 if a > 60 then player1x = (rand&127) + 20 : player1y = (rand/8) : a = 0

Later when you understand how variables work you will want to define them but for now it's a basic timer(tested).

Broken down it's simple: We have used variable 'a' in the example code. We have then instructed that 'a' equals itself plus 1 every drawscreen_loop. With that, there is an if statement asking if 'a' is greater then 60 then player1x... (execute remaining code) . We also reset the variable 'a' back to 0

 

As for trash cans you could use sprite flipping or a more complex algorithm however you will need to fully understand about using variables and bit operations first.

 

Audio well the code would look like this to set a sound

 AUDV0 = 4
 AUDC0 = 4
 AUDF0 = 4

however they are write only registers so you will need to set them all back to 0 to stop the sound tone.

 AUDV0 = 0
 AUDC0 = 0
 AUDF0 = 0
Edited by Tony The 2600
Link to comment
Share on other sites

 

I am half new myself. I will make a suggestion but don't take my word for it lol I have a few things to learn myself. BUT, in my games this is how it works for now.

I let the title screen loop, and if you press fire button you then go into the game. Fill in the code as you need, i'll leave it empty. Maybe it will help.

 

titleScreen


(fill in your title screen code here)
Ex:

 COLUBK=$00
 COLUPF=$00

 pfheights: 
 8
 8
 8
 8
 8
 8
 8
 8
 8
 8
 8
end

 playfield:
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
 ................................
end

  if joy0fire then goto startEngine   

   drawscreen 

      goto titleScreen

startEngine


       (build game code here.)

 return thisbank




 

Nice little template you have created and just a couple of tips: It's usually best to define your labels '_Label' using an underscore and higher case to prevent using key words used by bB. Also "return thisbank" will return back to the start of bank 1 and is used in bankswitching depending on the situation. I would use gosub or goto so you know exactly which label you're returning to. Anyway good stuff keep it up

  • Like 2
Link to comment
Share on other sites

Nice little template you have created and just a couple of tips: It's usually best to define your labels '_Label' using an underscore and higher case to prevent using key words used by bB. Also "return thisbank" will return back to the start of bank 1 and is used in bankswitching depending on the situation. I would use gosub or goto so you know exactly which label you're returning to. Anyway good stuff keep it up

Yea, it's not exactly how I do it in my game. Could have been done better, just a vague example for him to start playing with. I typed that up on my dinner break lol, didn't have access to my actual game script at the time. Hopefully he got some idea, he never responded lol.

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

Hey I did how you told me and it worked, got so into this that I forgot to respond :) but I had to use regular playfield titlescreen, letters only, couldn't figure out how to insert the one I drew from the picture above, didn't compile. The most important now is to figure out how to make those trash cans (playfield row 4) fall randomly. The guy here who did the Sewercleaner game did that thing, I looked at his code but had no idea what I was looking at lol. Thanx to all of you, this info has been helpful.

Edited by arcade_lights
Link to comment
Share on other sites

Ok guys, so I simplified the game. It's basically finished. What I originally imagined is way to complicated to accomplish, at least for now. I'll leave that for part 2. Now it's just dodging trash cans with scrolling playfield while tasing the rioters. However, there are still some issues. Whenever I lose a life, it immediately comes back, and I have 3 lives again, so game over is impossible. And I would also like to have pink sprites 2-5 in the bottom of the screen, just standing there, they're supposed to be gay, it's a gay parade and the pissed off cop is assigned to protect gays from hooligans :D For some reason I cannot get multisprite kernel to work, and the whole thing should at least look like gay parade. If you could help me with this I'd be really grateful. Here's the code again :)

 

 set romsize 4k
  include 6lives.asm
  set multisprite kernel 


 set kernel_options player1colors


 set kernel_options pfcolors: 




 dim sounda = a
 dim soundb = b


 drawscreen 


 pfcolors:
 $02
 $02
 $02
 $02
 $02
 $02
 $02
 $02
 $02
 $02
 $02
end


 playfield:
 .......X..........X.............
 .............................X..
 ...X........X.........X.........
 ................................
 ...................X............
 .........X...............X......
 ...X............................
 ....................X...........
 ................................
 ................................
 ................................
end






 COLUBK = $06


 player0x=80:player0y=80
 player1x=15:player1y=14
 missile0height=4:missile0y=255
 NUSIZ0 =16


 player0color:
 $9A
 $9A
 $9A
 $9A
 $9A
 $9A
 $9A
 $9A
end


 player0:
 %11000011
 %01000010
 %00111100
 %00111100
 %11111111
 %10011001
 %00011000
 %00111100
end




 player1color:
 $00
 $88
 $8A
 $02
 $02
 $02
 $FE
 $FE
end


 player1:
 %01100110
 %00100100
 %00011000
 %00011000
 %00111100
 %01111110
 %01011010
 %00011000
end








draw_loop
 drawscreen


 pfcolors:
 $02
 $02
 $02
 $02
 $02
 $02
 $02
 $02
 $02
 $02
 $02
end 




 COLUP0 = $94
 lives = 96 
 lifecolor = $94
  lives:
   %00000000
   %11111110
   %11111110
   %11111110
   %11111110
   %11111110
   %00000000
   %00000000
end


 scorecolor = $42




 if joy0left then player0x = player0x-3
 if joy0right then player0x = player0x +3


 if player1y < player0y then player1y = player1y + 1
 if player1y > player0y then player1y = player1y - 1
 if player1x < player0x then player1x = player1x + 1
 if player1x > player0x then player1x = player1x - 1






  if player0x < 14 then player0x = 14
  if player0x > 139 then player0x = 139






 NUSIZ0 = 0


 missile0y = 222
 missile0height = 30


 missile0y = missile0y - 2


 if joy0fire then missile0y=player0y-5:missile0x=player0x+8


 if sounda > 0 then sounda = sounda - 1 : AUDC0 = 8 : AUDV0 = 4 : AUDF0 = sounda else AUDV0 = 0
 if soundb > 0 then soundb = soundb - 1 : AUDC1 = 15 : AUDV1 = 10 : AUDF1 = soundb else AUDV1 = 0


 if joy0fire then soundb =12
 if player1x < 139  then sounda = 50




 if collision(missile0,player1) then score=score+10: soundb = 2: player1x=rand/2:player1y=0
 if collision(player0,playfield) then lives=lives-32: soundb = 39: player1x=rand/2:player1y=0: player0x=80:player0y=80
 if collision(player0,player1) then lives=lives-32: soundb = 39: player1x=rand/2:player1y=0:  player0x=80:player0y=80




 pfscroll down 


 goto draw_loop
  • Like 1
Link to comment
Share on other sites

If you attach your .bas file, it will be easier for others to mess around with your code.

 

Also, kernel options will not work with the DPC+ kernel or the multisprite kernel. Speaking of the standard kernel and kernel options, they aren't done separately. Check out this interactive chart:

 

randomterrain.com/atari-2600-memories-batari-basic-commands.html#kernelopchart

  • Like 1
Link to comment
Share on other sites

Hi again, the 'lives' code block is inside the draw_loop so your lives reset every frame. Place it outside the loop and it should work fine although you will need a gameover loop and an if statement

 COLUP0 = $94
 lives = 96 
 lifecolor = $94
  lives:
   %00000000
   %11111110
   %11111110
   %11111110
   %11111110
   %11111110
   %00000000
   %00000000
end
Link to comment
Share on other sites

Awesome! Thanx guys. Random Terrain, I inserted game over screen. There's only one strange thing, even though you put it in the program, when player0 and player1 collide, nothing happens?? They just stand one over another, and only then, when collided with the playfield, life is lost. If player0 hits the playfield alone nothing happens?

Edited by arcade_lights
Link to comment
Share on other sites

Awesome! Thanx guys. Random Terrain, I inserted game over screen. There's only one strange thing, even though you put it in the program, when player0 and player1 collide, nothing happens?? They just stand one over another, and only then, when collided with the playfield, life is lost. If player0 hits the playfield alone nothing happens?

 

I messed up. Attach your latest version and I'll fix it.

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