CodeWalrus

General => Other => Topic started by: xMarminq_ on November 29, 2016, 01:15:40 PM

Title: Basic Pacman
Post by: xMarminq_ on November 29, 2016, 01:15:40 PM
Hi. This is a project I will be doing alongside Time.
It is pretty self explanatory, as this game has been done by @MateoConLechuga .
But since I am a BASIC beginner, you may have seen me ask a ton of questions.
But I have a cton of things on its to-do list, like:
•Colored text, to easily differentiate everything, which requires that library program, please correct me
•AI
•A somewhat of a character that looks like this ៴, for a pacman going up, as i already have < > and ^
•Pacman controls
•Everything but the level design



Title: Re: Basic Pacman
Post by: aetios on November 29, 2016, 01:43:38 PM
(edited your message, you don't have to censor stuff like 'c' when it's totally obvious ;))

Looks interesting. It's on the CE, isn't it? I would recommend making the ghosts a single letter, maybe an O or something. The reason is that they're quite hard to distinguish right now. When you add in colors, you can also just color them to distinguish, further removing the need for different letters.
Looks good so far, though! How is the speed? I don't have a CE, so I can't test :)
Title: Re: Basic Pacman
Post by: xMarminq_ on November 29, 2016, 04:09:55 PM
All I have is the level design, and I have bronchitis  :'(
How do you make colored letters using the library program for home screen BASIC?
How can you detect certain letters/numbers at a certain coordinate?
Title: Re: Basic Pacman
Post by: E37 on November 29, 2016, 05:02:51 PM
I would have a string that is the screen which is updated along with the screen. You may even want to just display the string to update the screen.
I don't know how laggy displaying a string that takes up the whole screen is, you will have to try it. Using output instead of disp makes it so the text wraps.
If you have doors installed, there are a bunch of libs for programming which could be helpful.

*All of my information is accurate to my knowledge. Some of it could be slightly different since I am using a black and white calc.
Title: Re: Basic Pacman
Post by: xMarminq_ on November 29, 2016, 06:29:10 PM
It's a CE, but thanks for the help!
If you know anything about the CE, that would be great!
:thumbsup:
Title: Re: Basic Pacman
Post by: E37 on November 29, 2016, 06:47:05 PM
Quote from: xMarminq_ on November 29, 2016, 06:29:10 PM
It's a CE, but thanks for the help!
If you know anything about the CE, that would be great!
:thumbsup:
Everything I said should apply to the CE. I just added the disclaimer in the unlikely case that something was different. I am 98% sure that everything in my previous post should work just fine on the CE.
Sorry for the confusion  :-\

Basic on the 83+ is the exact same as the 84+ CE. (well... some of the screen commands are different of course)
Title: Re: Basic Pacman
Post by: Unicorn on November 30, 2016, 07:19:50 AM
Quote from: xMarminq_ on November 29, 2016, 06:29:10 PM
It's a CE, but thanks for the help!
If you know anything about the CE, that would be great!
:thumbsup:
YEah, that info should work perfectly fine on the CE.
Title: Re: Basic Pacman
Post by: xMarminq_ on November 30, 2016, 12:05:33 PM
Quote from: xMarminq_ on November 29, 2016, 04:09:55 PM
All I have is the level design, and I have bronchitis  :'(
How do you make colored letters using the library program for home screen BASIC?
How can you detect certain letters/numbers at a certain coordinate?

Halp
Title: Re: Basic Pacman
Post by: aetios on December 02, 2016, 11:01:15 AM
What have you tried so far?
Title: Re: Basic Pacman
Post by: xMarminq_ on December 02, 2016, 11:58:52 AM
All of it, but I ave No experience.  :banghead:
So difficult!
Title: Re: Basic Pacman
Post by: SiphonicSugar on December 02, 2016, 12:38:13 PM
For detection? Like are you talking about tile collision and that sort of thing?

If you are, you can have If sub(String1,24Y+X,1)="W":Then <restore coordinates to previous values>

Where Y is your character's Y value from up to down, X is the value from left to right, and W in the quotations is what ever character you want to stop the character from going into. And String1 is the string that you have the level displaying out of.
This will only work if you have a string display the whole page.
Title: Re: Basic Pacman
Post by: aetios on December 02, 2016, 01:04:47 PM
I get the idea that you're not using a map at all, are you? You can't just draw onto the screen and expect that to work, you need to keep track of the location of everything. Try making a map using a matrix.
Title: Re: Basic Pacman
Post by: p2 on December 02, 2016, 01:55:50 PM
save the map data you ant to show in a matrix and save changes in there, too.
and then simply display (the currently vissible part of) the matrix :)
if you use tiles, then save IDs in the matrix for example :)
Title: Re: Basic Pacman
Post by: SiphonicSugar on December 03, 2016, 04:03:02 AM
Quote from: a̩͕̻̤̹̒ͩ͒̃͊͢͡͞ͅę̱̝̘͓ͦ̚͘͠T̥̮̹̪̹̙̘̣̳̽̆ͩ͋̃̾̚͝Ḭ̈̌̋͑̅ͩͪ̒̚͢ͅoͫŝ on December 02, 2016, 01:04:47 PM
I get the idea that you're not using a map at all, are you? You can't just draw onto the screen and expect that to work, you need to keep track of the location of everything. Try making a map using a matrix.

Yeah, or try using a string, which in my opinion is way easier to edit. :p
Title: Re: Basic Pacman
Post by: Dream of Omnimaga on December 03, 2016, 07:19:23 AM
Yeah you need to use a map. A matrix should do.

I have some suggestions and tips:

1) For the walls, you could try using the equal sign that is white on a black background. It's not accessible from BASIC, but my game Legand of Zelda: Sord of Atari has it in the source code. Download it at ticalc.org (and yes, it's misspelled on purpose). Just copy the sign into a string or something so you can paste it in your code where needed. It might be easier to distinguish walls from the rest in such case.

2) You can't use color on the homescreen without ASM libraries. CE Textlib is what you need: http://www.ticalc.org/archives/files/fileinfo/465/46522.html . Run {14:Asm(prgmTEXTLIB at the start of your program, then use the following to change character and background colors (you don't need to specify the background everytime you change the text color):

{16,color,17,backgroundColor:Asm(prgmTEXTLIB . Both the color and background colors can be a number from 10 to 25 (the same as TI-OS colors, but there's an extra color in CE Textlib, which is teal (25). 0-9, 12 and 26-255 gives black color.

3) My recommendation, for speed, is to only use 1 color for all 4 ghosts. If you specify one color per ghost then the game will slow down drastically.

4) There are more advanced tricks with CE Textlib, but I would recommend staying away from them for now. There are some that I never tried myself.
Title: Re: Basic Pacman
Post by: Dream of Omnimaga on December 07, 2016, 11:36:07 PM
Double-post: I think I recall CE Textlib being able to detect the home screen content, so perhaps collision detection could be done this way.
Title: Re: Basic Pacman
Post by: xMarminq_ on December 08, 2016, 09:29:30 PM
That would be nice.

Title: Re: Basic Pacman
Post by: Dream of Omnimaga on December 09, 2016, 12:37:30 AM
Have you made any progress on the game, by the way?
Title: Re: Basic Pacman
Post by: xMarminq_ on December 09, 2016, 01:53:59 AM
School.  >:(