+Random Terrain Posted August 1, 2011 Share Posted August 1, 2011 (edited) After finding a better way to do things in the code of the 23 x 24 version of this, I came back and fixed the code in this 32 x 12 version. I often copy and paste REMs and I discovered some places where I forgot to change the text, so those places have been fixed too. Latest Version Here's the .bin file to use with an emulator or Harmony cart: ex_maze_32x12_2011y_08m_02d_1337t.bin Here's the bB code: ex_maze_32x12_2011y_08m_02d_1337t.bas ---------------------------------------------- Original Post Below is the first draft of a maze example program that I'm working on for the bB page. You can move the Pac-Man style sprite around and you'll also see an enemy sprite that randomly moves around the maze. I didn't give the enemy any brains in this example program. It's stupid and can't hurt you at this time. This started out as a 32 x 24 maze, but the scanline count kept going over 262 since there was a lot more pfread use. I had to drop back down to ugly town (32 x 12) for this example. If anyone who is great at math wants to look at my code and make it better, please do so. There are probably a lot of ways to improve the code, so feel free to fix it up and post it here. Here's the .bin file to use with an emulator or Harmony cart: ex_maze_2011y_07m_31d_2108t.bin Here's the bB code: ex_maze_2011y_07m_31d_2108t.bas Edited August 7, 2011 by Random Terrain 1 Quote Link to comment Share on other sites More sharing options...
Jr. Pac Posted August 1, 2011 Share Posted August 1, 2011 Thank you so much!!! Quote Link to comment Share on other sites More sharing options...
jrok Posted August 1, 2011 Share Posted August 1, 2011 Hey RT, I haven't taken a look at your code yet, but I know I did a 32x24 pf-avoidance routine for Circus Galacticus. If I recall correctly, I wound up doing most of the sprite coord-to-pf coord and case conditions during vblank to get the timing right. You might want to try stuffing some of the math into a vblank routine to cut down on cycle use. 2 Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 1, 2011 Author Share Posted August 1, 2011 Hey RT, I haven't taken a look at your code yet, but I know I did a 32x24 pf-avoidance routine for Circus Galacticus. If I recall correctly, I wound up doing most of the sprite coord-to-pf coord and case conditions during vblank to get the timing right. You might want to try stuffing some of the math into a vblank routine to cut down on cycle use. I totally forgot about that! It sure would be nice if I could go back up to 32 x 24. I'll try it tomorrow and see what happens. Thanks! Quote Link to comment Share on other sites More sharing options...
Jr. Pac Posted August 1, 2011 Share Posted August 1, 2011 Ugh! Another syntax error! How do I fix this one? ex_maze_2011y_07m_31d_2108t.bas Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 1, 2011 Author Share Posted August 1, 2011 Ugh! Another syntax error! How do I fix this one? I just tried it and don't get an error. Quote Link to comment Share on other sites More sharing options...
Jr. Pac Posted August 1, 2011 Share Posted August 1, 2011 I keep getting a syntax error! Quote Link to comment Share on other sites More sharing options...
ScumSoft Posted August 1, 2011 Share Posted August 1, 2011 I keep getting a syntax error! Got your compiler setup properly? Quote Link to comment Share on other sites More sharing options...
Jr. Pac Posted August 1, 2011 Share Posted August 1, 2011 Yes... I'll try again. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 1, 2011 Author Share Posted August 1, 2011 I keep getting a syntax error! Are you using the bBWin7_64bit.zip file mentioned here: http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#gettingstarted Quote Link to comment Share on other sites More sharing options...
Jr. Pac Posted August 1, 2011 Share Posted August 1, 2011 I had to redownload bB and now it works.... Quote Link to comment Share on other sites More sharing options...
Jr. Pac Posted August 1, 2011 Share Posted August 1, 2011 Can you please make one with dots worth 10 points each? That would be great! Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 1, 2011 Author Share Posted August 1, 2011 (edited) Can you please make one with dots worth 10 points each? That would be great! Unless some code genius makes a special kernel or minikernel for bB that can create a bunch of dots out of a ball or a missile, it's not going to happen. We have two sprites, playfield pixels, a ball, and two missiles (but usually only one missile or no missiles depending on the kernel_options used). Edited August 1, 2011 by Random Terrain Quote Link to comment Share on other sites More sharing options...
jrok Posted August 1, 2011 Share Posted August 1, 2011 Can you please make one with dots worth 10 points each? That would be great! Why don't you make one with dots worth 10 points each? Or is RT supposed to write "your" game? 3 Quote Link to comment Share on other sites More sharing options...
Jr. Pac Posted August 1, 2011 Share Posted August 1, 2011 Can you please make one with dots worth 10 points each? That would be great! Why don't you make one with dots worth 10 points each? Or is RT supposed to write "your" game? I need to learn before I write code. I don't know how. Isn't it possible, RT? How does the original Ms. Pac-Man/Pac-Man/Jr. Pac-Man/clones use it? It has to be possible. Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted August 1, 2011 Share Posted August 1, 2011 I need to learn before I write code. I don't know how. Its normal to learn while you write code. If you can't handle RT's example you really should be experimenting with other peoples code or start with far simpler things before you try and write a full game. 1 Quote Link to comment Share on other sites More sharing options...
jrok Posted August 1, 2011 Share Posted August 1, 2011 Can you please make one with dots worth 10 points each? That would be great! Why don't you make one with dots worth 10 points each? Or is RT supposed to write "your" game? I need to learn before I write code. I don't know how. If you mean that you don't have any programming experience at all, then perhaps you should start simple. I'd think that asking someone to write your game for you defeats the purpose of the hobby. Isn't it possible, RT? How does the original Ms. Pac-Man/Pac-Man/Jr. Pac-Man/clones use it? It has to be possible. RT is referring to the setup of the bB 1.0 standard kernel, which draws the entire screen at once, including the five objects he mentioned and the playfield pixels. Atari's Pac-Man "dots" were done with done with playfield pixels (which is why they look more like "dashes"), and the three ghosts were created by flickering player0 and player1 on alternating frames. I'd recommend you also go with playfield pixels for your dots. Quote Link to comment Share on other sites More sharing options...
Jr. Pac Posted August 1, 2011 Share Posted August 1, 2011 I need to learn before I write code. I don't know how. Its normal to learn while you write code. If you can't handle RT's example you really should be experimenting with other peoples code or start with far simpler things before you try and write a full game. I don't know what you mean. I can handle RT's code. Quote Link to comment Share on other sites More sharing options...
Jr. Pac Posted August 1, 2011 Share Posted August 1, 2011 Can you please make one with dots worth 10 points each? That would be great! Why don't you make one with dots worth 10 points each? Or is RT supposed to write "your" game? I need to learn before I write code. I don't know how. If you mean that you don't have any programming experience at all, then perhaps you should start simple. I'd think that asking someone to write your game for you defeats the purpose of the hobby. Isn't it possible, RT? How does the original Ms. Pac-Man/Pac-Man/Jr. Pac-Man/clones use it? It has to be possible. RT is referring to the setup of the bB 1.0 standard kernel, which draws the entire screen at once, including the five objects he mentioned and the playfield pixels. Atari's Pac-Man "dots" were done with done with playfield pixels (which is why they look more like "dashes"), and the three ghosts were created by flickering player0 and player1 on alternating frames. I'd recommend you also go with playfield pixels for your dots. I'm just asking for a snippet of code. What about the Pac-Man clones with dots, not "Video Wafers?" I would need extra big sprites for the characters to to make dots, because the "lanes" would have to be 3 playfield pixels wide. Quote Link to comment Share on other sites More sharing options...
jrok Posted August 1, 2011 Share Posted August 1, 2011 (edited) I need to learn before I write code. I don't know how. Its normal to learn while you write code. If you can't handle RT's example you really should be experimenting with other peoples code or start with far simpler things before you try and write a full game. I don't know what you mean. I can handle RT's code. I think he means that you've just been handed a boat, a paddle, a net, a brand new fishing pole and a bucket of bait, but now you are asking someone to catch the fish and cook them for you. Before you go any further, you might want to spend a few days modifying and experimenting with RT's code here. All of us were beginner programmers at one time, and I guarantee that's how most of us began to understand code and start writing our own. Edited August 1, 2011 by jrok 1 Quote Link to comment Share on other sites More sharing options...
jrok Posted August 1, 2011 Share Posted August 1, 2011 Can you please make one with dots worth 10 points each? That would be great! Why don't you make one with dots worth 10 points each? Or is RT supposed to write "your" game? I need to learn before I write code. I don't know how. If you mean that you don't have any programming experience at all, then perhaps you should start simple. I'd think that asking someone to write your game for you defeats the purpose of the hobby. Isn't it possible, RT? How does the original Ms. Pac-Man/Pac-Man/Jr. Pac-Man/clones use it? It has to be possible. RT is referring to the setup of the bB 1.0 standard kernel, which draws the entire screen at once, including the five objects he mentioned and the playfield pixels. Atari's Pac-Man "dots" were done with done with playfield pixels (which is why they look more like "dashes"), and the three ghosts were created by flickering player0 and player1 on alternating frames. I'd recommend you also go with playfield pixels for your dots. I'm just asking for a snippet of code. What about the Pac-Man clones with dots, not "Video Wafers?" I would need extra big sprites for the characters to to make dots, because the "lanes" would have to be 3 playfield pixels wide. Oh, well that's simple then. Just write a custom kernel that allows you to display both missiles and the ball on every line. Then, perhaps with 30hz flicker, you could get up to 8 square "dots" on each scanline. It's an easy fix... just a "code snippet" really. RT could you jump on that ASAP, so that Junior Pac can complete his masterpiece? Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 1, 2011 Author Share Posted August 1, 2011 (edited) Isn't it possible, RT? How does the original Ms. Pac-Man/Pac-Man/Jr. Pac-Man/clones use it? It has to be possible. They used assembly language. You might want to read Racing the Beam: http://www.amazon.com/Racing-Beam-Computer-Platform-Studies/dp/026201257X And although it's not about Pac-Man games, you might want to watch this video: http://www.youtube.com/watch?v=MBT1OK6VAIU&rel=0&fmt=35 batari Basic is amazing because it lets average people who only know BASIC style languages get the beginnings of a game up on the screen in minutes instead of days or months. The speed and ease of use come at a cost, though. For example, we can't have hundreds of dots on the screen and we can't have 50 multicolored sprites flying around. We have to figure out how to make fun games within the limitations of bB or learn assembly language or move on to something like Multimedia Fusion 2: http://www.youtube.com/watch?v=2x-wq5RIwbA&rel=0&fmt=35 The guy is speaking French, but the two videos below show him making a Pac-Man type game: http://www.youtube.com/watch?v=IuQT4oliWko&rel=0&fmt=35 http://www.youtube.com/watch?v=Jd90YtEfWcQ&rel=0&fmt=35 Edited August 1, 2011 by Random Terrain 2 Quote Link to comment Share on other sites More sharing options...
johnny_boy Posted August 1, 2011 Share Posted August 1, 2011 Random Terrain, you are a very patient man. Kudos to you. Quote Link to comment Share on other sites More sharing options...
NE146 Posted August 1, 2011 Share Posted August 1, 2011 I need to learn before I write code. I don't know how. Quote Link to comment Share on other sites More sharing options...
jrok Posted August 1, 2011 Share Posted August 1, 2011 (edited) For example, we can't have hundreds of dots on the screen and we can't have 50 multicolored sprites flying around. Well, I doubt we could have 50 sprites flying around, but hundreds of dots should be possible. You would just have to make some creative use of the sprites and flicker. For instance, in the following binary the first example shows a grid of 384 dots (using both P0 and P1), and the second example shows a 9x6 dot grid, using only a single player sprite. Press and release the fire button to toggle between examples. Dots.bas.bin It looks okay in Stella with Phospor turned on. I just mocked these up real quick, but ultimately for a "dot-eater maze game", I think the idea would be to make use of the multiplexed P1 in the DPC+ kernel. In that case, you could potentially have 9 independent sprite rows on one frame, resizing them to %00000011 to get 27 dots. Then you could do the same on the next frame, but reposition their x to create a 30hz grid of 54. By tracking the position of the "eater" versus the grid, you could resize each sprite accordingly, making the dots vanish as you "eat" them. 54 isn't a heck of a lot of dots, but it's probably doable in pure bB (DPC+). Edited August 1, 2011 by jrok Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.