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.
Messages - Xeda112358
Pages: 1 ... 141 142 [143] 144 145 ... 317
2131
« on: March 15, 2012, 02:55:57 pm »
I know you have been posting in the Grammer threads, too, so I will explain how to do it in Grammer (and probably Axe/Asm) and see if you can do it on the NXT: First, can you draw or pixel test on other buffers? If so, for what I have been doing today. For each enemy, I have two sprites. One to be displayed and the other contains the hit as pixels on. For example, I draw this sprite to the viewing buffer:  Then on the other buffer, I draw this hitbox at the same location:  There is no need to make it like this, either. You can have a huge hitbox for enemies with some kind of aura or things like that. Anyways, then all I need to do is whenever I move, I just pixel test the location I am moving to. If there is a pixel on, it means it is in the hitbox. so you just don't move there. The nice thing is, you can have several buffers for other things. For example, one buffer for collision, one buffer for killzones, et cetera. Again, this all relies on the ability to pixel-test other buffers. I don't know if this helped clarify things or not
2132
« on: March 14, 2012, 09:20:52 pm »
Yeah, we went over this before, didn't we?  (in another topic) It can do over 3500 at 15 MHz
2133
« on: March 14, 2012, 07:23:54 pm »
Well, think of it this way-- If I can do over 1000 pxl-tests in a second, then checking if I am in the kill zone will not be a problem at all.
2134
« on: March 14, 2012, 04:26:49 pm »
First download  Awesome job, calc
2135
« on: March 14, 2012, 03:51:31 pm »
2136
« on: March 14, 2012, 07:53:16 am »
Also, I am not sure if DCS7 and Grammer play poorly together. (You won't be able to run a Grammer program from DCs7, anyways, though)
2137
« on: March 13, 2012, 11:55:16 pm »
In a similar vein, you can do some soft-core SMC to speed up a routine such as pixel-testing or even turning the pixel on or off:
;=============================================================== PlotPixel: ;=============================================================== ;Inputs: ; B is the x-coordinate ; C is the y-coordinate ; D=Method ; 1=Test ; 2=Off ; 3=On ; (BufPtr) points to the buffer to draw to ;Outputs: ; BC is equal to (BufPtr) ; DE not modified ; HL points to the byte the pixel is drawn to ; When using the pixel test method: ; z means pixel off ; nz means pixel on ;Destroys: ; A ;=============================================================== ld a,3Fh ;7 srl b \ rra ;12 19 srl b \ rra ;12 31 srl b \ rra ;12 43 cpl ;4 47 or d ;4 51 rrca \ rrca ;8 59 ld (Method),a ;13 72 ld a,b ;4 76 ld b,0 ;7 83 ld h,b \ ld l,c ;4 87 add hl,bc ;11 98 add hl,bc ;11 109 add hl,hl ;11 120 add hl,hl ;11 131 ld c,a ;4 135 add hl,bc ;11 146 ld bc,(BufPtr) ;20 166 BufPtr points to the buffer add hl,bc ;11 177 .db $CB ;15 192 First byte of BIT Method: .db 46h ; second byte of the BIT instruction ret ;10 202 37 bytes
2138
« on: March 13, 2012, 09:46:45 pm »
How about add hl,(**)? I would use that in cases where, say, HL is the offset into a buffer and the location of the buffer is at **. Or an instruction I just invented off the top of my head:
asjnc *
It performs add a,c \ sub b and does a relative jump if it did not go below zero. That might be useful, especially for line drawing and circle drawing and whatnot. I think it would be 16 cycles using the current processor.
2139
« on: March 13, 2012, 05:36:52 pm »
Okay, I am trying to think of what could be wrong  As for grayscale, here is what you can try: Store pi9872 to a pointer-- this is where a 768-byte buffer is located. I'll call the pointer G, for Gray. Now do this: Disp oG to set the gray buffer. Now when you draw, you draw the gray stuff to buffer G and black to the normal buffer. To make white, you need to erase on both buffers. You also need to be constantly updating with DispGraph for it to appear gray. To draw to the gray buffer, most drawing instructions will let you use an extra argument to point to the buffer. For example, to draw a rectangle to the gray buffer: Lined(0,0,8,8,1,G I hope that helps!
2140
« on: March 13, 2012, 03:33:08 pm »
Hi! And I get it, Stefan  Um, so would you like some complimentary  with your stay? Enjoy!
2141
« on: March 13, 2012, 03:17:37 pm »
I also wrote the code in assembly and for things like this, the process can be really sped up. I am not sure how other languages compare.
2142
« on: March 13, 2012, 03:12:08 pm »
I now have the MORPION program done  I wrote it during class today and it has a few nice features. I won't tell the features or anything that it does, though, because I don't think I can. I am not sure how the judging works, but I think the programs are submitted with your secret number, then scored, and then matched up with the correct person at the end.
2143
« on: March 13, 2012, 03:03:02 pm »
Wow  48Hz is 8 times faster than the calc. Okay, some pseudo code... Make a finite array of, say, 12 elements. This is the data for 6 particles. The elements are: {X 1,Y 1,X 2,Y 2,X 3,Y 3,X 4,Y 4,X 5,Y 5,X 6,Y 6} So loop through the particles like this: For the first particle, get (X 1,Y 1). Test the pixel below that coordinate. If it is empty, do Pxl-Off on the original, Pxl-On to the new location and change Y 1. If it is not empty, randomly select left or right to test first. If it is empty, move there, adjusting pixel states and updating X 1. If that is not available, check the other left/right and do the same. Finally, if that isn't empty, either, do nothing. Since the particle should not be starting on any already made pixels, it never occupies an already occupied space and so it does not delete any original contents. It only deletes itself from frame to frame. In BASIC, I did this: {3,3,3,3,3,3→L1 ;Y-coordinates Ans→L2 ;X-coordinates Repeat getKey=45 For(A,1,6 L2(A→X L1(A→Y If pxl-Test(Ans+1,X Then ;This checks left/right 2randInt(0,1)-1→B ;B becomes 1 or -1 If pxl-Test(Y,X+B -B→B If not(pxl-Test(Y,X+B Then Pxl-Off(Y,X X+B→L2(A Pxl-On(Y,Ans End Else Y+1→L1(A Pxl-Off(Y,X Pxl-On(Ans,X End End End
You will see it doesn't go nearly as fast in BASIC which is why I did it in ASM >.>
2144
« on: March 13, 2012, 02:22:23 pm »
I'm 1083  Also, I probably signed up for an account a few years before I became active. I think DJ deleted it for me, though
2145
« on: March 13, 2012, 08:49:36 am »
The array is stored elsewhere. As long as you have a pointer to the array, you are fine  The location is generally a fixed location for the duration of the program, though.
Pages: 1 ... 141 142 [143] 144 145 ... 317
|