Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Potato

Pages: [1]
1
TI Z80 / Chess in Basic
« on: September 27, 2011, 05:06:59 pm »
[Edit: Also had another problem.  I wanted to have a banner on the side so that when a piece is selected it showed the name plus a more detailed drawing.  Is there anyway that I can clear just that section of the screen with ease?  I might be able to do clrdraw with what hot_dog suggested since with that I can just remake the board, haven't tried it out, but I want to have a back up plan]

Currently working on Chess in Basic and could use a little bit of help.  So far I've only coded very basic parts of it but I've noticed during testing that it's already a little slow.  In a nutshell what my program does is:

-Display the picture of the chess board (including the pieces already on it.  I chose this method so that I could archive and unarchive pics within the program and also save games)
-Draw the cursor.  
-Get key so that the cursor can move left, right, up and down while also allowing the player to select a piece (by pressing 2nd).
-When 2nd is press the prgm checks the pixels in that square.  It can determine the difference between a black square, white square, and every single piece. (it sees rooks and bishops as the same but this shouldn't be a -problem)
-If a piece is selected it determines what piece it is (it determines if it's a piece at all first) and then what moves are available to it (and if it's a pawn if it's able to "jump" two squares) [at the moment I only have it programmed for pawns).  All available moves are shown with a x through the square and all remaining pixels are darkened (a black square is actually a checkered square).  If 2nd is pressed again on the pawn it reverts the available moves back to their original square type.

But even though I've only programmed white pawns (not even the black pawns yet) it takes about a half second for the cursor to move, and even longer to display the available moves. Before I continue I want to try and speed up this program so that it runs faster and not take 10 seconds per cursor move, (let alone moving to the piece you want)



Other non important stuff:
Each piece is not saved as a pic.  I also plan to have the original pic drawn in using pic on and pic off but only at the end when I'm sure this works.  
Each piece is not a variable.  The program checks the pixels to determine what each square is, not what variable is where.
I actually can't move a piece yet.  I simply haven't programmed it to but I'm fairly confident I could if I decided to put it in.
It will be a person vs person game.  Not a person vs computer game.  I'd rather it have AI but I'm not sure how to make this, if you know how that'd also be helpful. (Keep in mind this is in BASIC).

2
TI-BASIC / Quick Question
« on: March 31, 2011, 08:37:20 pm »
[Ugh sorry for new post...This isn't really worth of it but I don't have enough posts for shoutbox yet]

How do you unarchive/archive programs inside of programs, or is it even possible?

I have this little organizer I made for all the programs I have.  The main idea was so that I can keep all my things archived and still be able to access them.  Only problem is that it won't let me unarchive/archive them.

The way I had it set up was

:If z=34
:Then
:unarchive PRGMprogramname
:PRGMprogramname
:archive PRGMprogramname
:end

3
TI Z80 / Tetris on the calculator - Help?
« on: March 31, 2011, 07:43:35 pm »
[This is my first post and I'm still a little confused so sorry if I post this in the wrong place]
[Yes I already know it's been made]
Hey, I'm a amateur coder using BASIC and my current project is Tetris.  So far I have my program to do these things (in this order)

1) Loop
2) Rand int (1,7)
3) Run a program based on the number randomed
4) The program than creates the tetris piece (right now it's a letter but I'm going to fix this later)
5) The tetris piece than falls at a constant rate with a imprint of the same piece under it  (This does not fall) (The tetris piece can be moved left and right; hard and soft drop to be added later)
6) Once the tetris piece lands the bottom of the screen (where the imprint is) is cleared
7) Loop again

Problems I have:
-[Solved, thanks guys] The tetris pieces don't stack.  Right now it isn't coded to but I can't think of a realistic way to do this
-I can't spin the tetris pieces.  Again can't think of a real way to do this (other than when the spin button is pressed it changes the piece all together to the spun all together)
-Can't make tetris pieces (realistically)

Things to be implemented
-Score and high scores (not sure if I want to add this)
-Ability to clear
-User interface
-Menu
-Hold
-Specials (perfect clear, t-spin, tetris etc etc etc)

If it's any help, each of the blocks that make up the tetris pieces will be 2x2 pixels (most likely) and each tetris piece is composed of 4 tetris blocks.  


Pages: [1]