0 Members and 2 Guests are viewing this topic.
The plain grey ones kill you instantly . The thing that's really cool about them is that they actually aren't grey, they're really a 2 frame animated checkerboard tile! That's really a pretty cool way to do it, Darl, props. Also, when I post it tells me that the max number of attachments is 50 Anyway. Yeah, so if you look at the code, it's basically an optimized version of Code: [Select]Y/4*24+(X/4)+L1->GY/4*24+(X+3/4)+L1->F Basically what it does, is it reduces your pixel coordinates to tile coordinates (the divide by 4). The Y value is multiplied by 24 because that's how wide the map is (It's now treated as a simple array). I use two values to check which tile the left and right side of the character is in. And now you can add or subtract from F and G to get different tiles; eg {F+24} is like adding one row's worth, and hence one tile down.inData is a smaller way of doing If var=something or (var=something else) I believe the line reads If inData({F}+1,[040600])? So since both values 3 and 5 are respawn points, it checks if the current tile is either 3 or 5. But the data needs to be zero-terminated, which is why I added the +1 there. (and then scaled up the appropriate values)
Y/4*24+(X/4)+L1->GY/4*24+(X+3/4)+L1->F
For(A,0,12) //For 13 columns...For(B,0,8) //For 9 rows...{Y/8 //Take the Y position, divide by 8 to get the tile offset-4 //But the character is in the middle of the screen, so -4 tiles worth+B*32 //Add tilemapper's Y value, then multiply by 32 because that's how many tiles wide my maps are+(X/8+A)-6 //Same as before but with X+L1}->C //Level data is stored in L1Pt-On(A*8-(X^8),B*8-(Y^8),C-1*8+Pic1 //X^8 and Y^8 are the pixel offsets of the playerEndEndEnd
getKey(3)-getKey(2)+A //If right, +1. If left, -1!If +1 //If A+1=0, that is, if A = -1. Right now, hl=A+1+1 //+1 to value in HLEnd-1 //Before, hl=A+1. So we have to -1 to it. If A=-1 before, now the value in HL=0min(,max value)->A //Leaving the first argument blank inserts hl in. So basically, this compares A and the maximum value and returns the smaller one.
:.DTILEMPR:[F0F0F0F000000000]→Pic0N:[A0A0505000000000]→Pic1J:[6040206000000000]→Pic1S:[6040604000000000]→Pic1F:[9000009000000000]→Pic1R:[A050A05000000000]→Pic1D:[000C030000000000]→Pic1W:DiagnosticOff:"vTIOLVL"→Str1:GetCalc(Str1)→P:Return!If P:conj(P,L1,384:0→N→O→I→J-1→E:.I and J are coordinates of top left corner:.N and O are tile offsets::ClrDraw:.draw init image:For(Y,0,15:Y*4→T:For(X,0,23:X*4→S:E+1→E:sub(DRW:End:End:DispGraph:Repeat getKey(15):Repeat getKey(0):End:If getKey(54):ClrHome:.display stuff:Disp "random info",i,"I",I►Dec," J",J►Dec,i,"N",N►Dec," O",O►Dec:While getKey(54):Pause 10:End:End::If getKey(1) xor (getKey(4)):.vert movement::If getKey(4):Vertical +:O+1→O:If O>>3:J-1→J:O-4→O:For(A,0,23:A*4-N→S:0-O→T:J*24+I+A→E:sub(DRW:End:End:End::If getKey(1):Vertical -:O-1→O:If O<<1:J+1→J:O+4→O:For(A,0,23:A*4-N→S:64-O→T:J*24+I+A+360→E:sub(DRW:End:End:End::End::If getKey(2) xor (getKey(3)):.horiz movement:If getKey(2):Horizontal +:N+1→N:If N>>3:N-4→N:I-1→I:For(A,0,15:0-N→S:A*4-O→T:J*24+I+(A*24)→E:sub(DRW:End:End:End:If getKey(3):Horizontal -:N-1→N:If N<<1:N+4→N:I+1→I:For(A,0,15:96-N→S:A*4-O→T:J*24+I+(A+1*24)→E:sub(DRW:End:End:End::::End:DispGraph:End:::Lbl DRW:Pt-On(S,T,Pic0N:Pt-Change(S,T,Pic0N:.pt-on stuff:!If {L1+E}-1:Pt-On(S,T,Pic0N:Else!If {L1+E}-2:Pt-On(S,T,Pic1J:Else!If {L1+E}-3:Pt-On(S,T,Pic1S:Else!If {L1+E}-4:Pt-On(S,T,Pic1F:Else!If {L1+E}-5:Pt-On(S,T,Pic1R:Else!If {L1+E}-6:Pt-On(S,T,Pic1D:Else!If {L1+E}-7:Pt-On(S,T,Pic1W:End:.Return
:.DTILEMPR:[F0F0F0F000000000]→Pic0N:[A0A0505000000000]→Pic1J:[6040206000000000]→Pic1S:[6040604000000000]→Pic1F:[9000009000000000]→Pic1R:[A050A05000000000]→Pic1D:[000C030000000000]→Pic1W:DiagnosticOff:"vTIOLVL"→Str1:GetCalc(Str1)→P:Return!If P:conj(P,L1,384:0→N→O→I→J-1→E:.I and J are coordinates of top left corner:.N and O are tile offsets::ClrDraw:.draw init image:For(Y,0,15:Y*4→T:For(X,0,23:X*4→S:E+1→E:sub(DRW:End:End:DispGraph:Repeat getKey(15):Repeat getKey(0):End:If getKey(54):ClrHome:.display stuff:Disp "random info",i,"I",I►Dec," J",J►Dec,i,"N",N►Dec," O",O►Dec:While getKey(54):Pause 10:End:End::If getKey(1) xor (getKey(4)):.vert movement::If getKey(4):Vertical +:O+1→O:If O>>0:J-1→J:O-4→O:End:For(A,0,24:A*4+N→S:O→T:J*24+I+A→E:sub(DRW:End:End::If getKey(1):Vertical -:O-1→O:For(A,0,24:A*4+N→S:64+O→T:J*24+I+A+384→E:sub(DRW:End:If O<<⁻3:J+1→J:O+4→O:End:End::End::If getKey(2) xor (getKey(3)):.horiz movement:If getKey(2):Horizontal +:N+1→N:If N>>0:N-4→N:I-1→I:End:For(A,0,16:N→S:A*4+O→T:J*24+I+(A*24)→E:sub(DRW:End:End:If getKey(3):Horizontal -:N-1→N:For(A,0,16:96+N→S:A*4+O→T:J*24+I+(A+1*24)→E:sub(DRW:End:If N<<⁻3:N+4→N:I+1→I:End:End::::End:DispGraph:End:::Lbl DRW:Pt-On(S,T,Pic0N:Pt-Change(S,T,Pic0N:.pt-on stuff:!If {L1+E}-1:Pt-On(S,T,Pic0N:Else!If {L1+E}-2:Pt-On(S,T,Pic1J:Else!If {L1+E}-3:Pt-On(S,T,Pic1S:Else!If {L1+E}-4:Pt-On(S,T,Pic1F:Else!If {L1+E}-5:Pt-On(S,T,Pic1R:Else!If {L1+E}-6:Pt-On(S,T,Pic1D:Else!If {L1+E}-7:Pt-On(S,T,Pic1W:End:.Return
Awesomeness, it works!!! Thanks Now I just need to come up with a way to do this in the editor, and prolly by v8 or so there will be scrolling fully implemented!EDIT: ok, apparently post rating doesn't work in this proxy...