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.


Messages - MGOS

Pages: 1 ... 6 7 [8] 9 10 ... 23
106
TI Z80 / Re: [Axe] Bullet Proof
« on: September 20, 2012, 01:30:49 am »
The last screeny should be it except for the machine guns.

107
TI Z80 / Re: Nemesis- a new axe 3d rpg
« on: September 19, 2012, 12:59:55 pm »
I think DJ meant the diagonal walls. Would it be faster if you could reduce your algorithm for only perpendicular walls?

108
TI Z80 / Re: [Axe] Bullet Proof
« on: September 19, 2012, 12:17:45 pm »
I couldn't do much on this, I've been working on another "scientific useful" project for some time now, but nonetheless here is an update:  :)

Added:
  • Automatic Archive/Unarchive safe file (no big deal, but was missing before)

Changed:
  • Fixed phantom grenades / grenades exploding much too late / grenades disappearing (occurred when both players throw a grenade the same time)
  • Downgraded the machine gun: only 9 shots, fire rate reduced from 200% to 150% (recommended by a friend)
  • Reduced grenade timer by 20% (explodes after 80 frames)

Since it isn't an update with changed graphics / major changes on game mechanics, I won't add a screeny.

Download:

109
Miscellaneous / Re: My new internet speed
« on: September 18, 2012, 08:08:45 am »
Could be better, but it's enough for me :)


110
TI Z80 / Re: Nemesis- a new axe 3d rpg
« on: September 15, 2012, 11:19:39 am »
If you have a second memory location to store the sorted array, this might be useful:

Pseudocode:
Code: [Select]
ptr = 0
For each element
Look for largest element
Write that data to (ptr)
Make original element 0
ptr++
Next element
Copy new array to original array


111
TI Z80 / Re: AxeDCS
« on: September 09, 2012, 04:10:25 am »
Awesome! Text input and custom buttons! Can't wait to try it out

112
Axe / Re: How to create 4 level greyscale in Axe?
« on: September 05, 2012, 04:27:22 pm »
Ooh, thanks, it works now, Time to go see If i can remove flicker now.
What flicker? There shouldn't be any flickering except when your loop is two slow. Can you post your code?

113
Axe / Re: How to create 4 level greyscale in Axe?
« on: September 05, 2012, 03:16:04 pm »
I meant the "..." also why is it pt-off instead of pt-on?

Yeah, remove the dots (you can add other code in there, like movement)
Make sure to initialize X and Y or replace them with constants.

Pt-Off is slightly faster than Pt-On (when X is a multiple of 8 ), so that's why I used that for the example. But doesn't really matter.

Hex:
[FFFFC3C3C3C3FFFF] for front buffer
[FF81BDA5A5BD81FF] for back buffer

That should be a neat little box with all colors!

114
Axe / Re: How to create 4 level greyscale in Axe?
« on: September 05, 2012, 02:36:52 pm »
Here is a more in-depth how-to:

The TI-83 series doesn't support grayscale natively, but axe has some functions to alternate checkerboard patters, but that is so fast (and the screen is blurry too), so that it looks for the human eye like it is gray.

Because one buffer can only store data for two colors, you'll need two buffers for 2² = 4 level grayscale. Depending on the pixel combination of both buffers you can get black, dark gray, light gray and white. The easiest way (for me) to remember the combinations is, that the main buffer has a higher "priority" or "level" than the back buffer, so if you change a pixel on the front buffer, it'll cause the result to change more than when you do it on the back buffer.
Here are the combinations for 4 level grayscale:

Front buffer: 
Back buffer:
Result:
off
off
white 
off
on
light gray 
on
off
dark gray 
on
on
black 

In order to display a 4-level sprite, you have to create two 8x8 sprites, one for the front buffer, one for the back buffer. With the table above as reference, you can make your 2 sprites out of the one desired gray sprite.

To display them, you need two Pt-commands:

Code: [Select]
[Hex for Front buffer]→Pic1A  ; you can use other names for pointers if you want
[Hex for Back buffer]→Pic1B
...
ClrDrawrr  ; clears both buffers at the same time
While 1
...
Pt-Off(X,Y,Pic1A)   ; X and Y are the coordinates
Pt-Off(X,Y,Pic1B)r
...
DispGraphClrDrawrr   ; for 4 level you need two radian r's
...
EndIf getkey(15)

For 3 level grayscale you need DispGraphr, for 4-level you need rr. Same when you use the DispGraphClrDraw.

Every time the DspGraphrr is passed, the checkerboard pattern is changed.

That should be it.

115
Axe / Re: Enemies Freezing after another enemy is shot? (UPDATED)
« on: September 04, 2012, 12:33:49 pm »
Also would the arithmetic logic be a good optimization for speed on a ti84+SE?
For "+" always, but for the multiplying I have to admit that runer's right. Take the bitwise "and" when you compare booleans.


Note:
"2 and 1" would be true in boolean, but you have to use multiplication because the bitwise "and" would return zero.

116
Axe / Re: Enemies Freezing after another enemy is shot? (UPDATED)
« on: September 04, 2012, 12:03:19 pm »
Only applies if the pointer is not a constant! :P L2 is a constant, so that part of his code is fine.
Whoa, didn't know that!  :)

Remember, the syntax to create a list of data in Axe is different from that in TI-BASIC:
Data(0,1,4,9,16,25,36,49,64,81,100,121,144,169,196,225)→GBD1
Stupid mistake  :banghead:

And for the "3"-key mistake: I just copied from the source, but you can blame me for not checking it ;D

Thanks runer, you make me always learn new things!

117
Introduce Yourself! / Re: Hi There!
« on: September 04, 2012, 11:49:26 am »
Not really, just make each piece an object, and make it follow the rules depending on the pieces ID, check against a rules class.
Ok, cool - can't wait :)

118
Introduce Yourself! / Re: Hi There!
« on: September 04, 2012, 11:39:23 am »
I might actually do this, given I have enough time, It seems simple enough.
I think the most difficult part is to check whether a move is possible or not. (Right player's turn, piece can move in that pattern, no other pieces are in between (except for the knights))

119
Introduce Yourself! / Re: Hi There!
« on: September 04, 2012, 05:32:56 am »
Just an idea...
How about an IRC bot which hosts a chess game? The players type their moves like b2-b4 and the bot checks if the moves are valid/legal and prints the board.  :P

120
Axe / Re: Enemies Freezing after another enemy is shot? (UPDATED)
« on: September 04, 2012, 04:25:26 am »
Oh I see, should I use the Fill( command to zero out the ram?
No, just do 0→{L2}

What is a LUT and what does inData do?
LUT stands for Look-up-table. It is basically just a constant array with values. You can get each value by accessing the data with an index. That is usually a lot faster than having a calculation for it.

Example:
Code: [Select]
{0,1,4,9,16,25,36,49,64,81,100,121,144,169,196,225}→GBD1  ; a LUT with the squares of 0-15
...
instead of a calculation like
A²→B
you can use the LUT:
{A+GBD1}→B

The speed difference isn't that big in such an easy example, but with the complexity of the calculation you can avoid it gets more notable.
Other examples for LUTs: Frequencies for Music, characteristics/properties of different weapons/armor/enemies, ...

You have to make sure that the index doesn't get out of range, otherwise is it'll do weird stuff, e. g when A is 16 or larger, it'll still read the data after the LUT.

You can use an LUT also the other way round. Axe provides the function inData() for that.

Quote from: Axe Command List
inData(BYTE,PTR)     Searches for BYTE in the zero-terminated data. If found, it returns the position it was found in (starting at 1). If not found, 0 is returned.

Zero-terminated means, that the last value of the LUT has to be 0 respectively the first 0 in the LUT is considered as the end.

Say, at the beginning of the code we have a LUT with our keys, ending with 0:
Code: [Select]
{33,34,26,16,0}→GBD1at the point where we need the data, we use inData().
Code: [Select]
If inData(K,GBD1)→F   ; if the key is one of the weapon selectors
F-1→L         ; take this value (1-4) and subtract 1 (then we have 0-3) and store it in L.
End
optimized to save a variable:
Code: [Select]
If inData(K,GBD1)   
-1→L   ; that is the subtraction minus sign, same as above. It subtracts from the last evaluated expression, which is "inData"
End


I never knew about the "+" and "*" operations
I'm sure you know them "+" does add and "*" does multiply.  :P

But for conditions they can be used as well:
"+" is "or"
(cond 1) + (cond 2)
When either of the conditions is non-zero, the sum will be non-zero. (non-zero means "true", zero is "false")
Attention! If one of the conditions is negative, they might add up to 0 too!

"*" is "and"
(cond 1) * (cond 2)
When either of the conditions is zero, the product is zero. So all the conditions have to be non-zero, to make the whole statement non-zero.

I hope that cleared things up a bit.

Pages: 1 ... 6 7 [8] 9 10 ... 23