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 - squidgetx
Pages: 1 ... 59 60 [61] 62 63 ... 123
901
« on: February 03, 2011, 08:09:53 pm »
Added discussion regarding preevaluating expressions. It seems easy, but sometimes you don't remember to do it (I know I didn't in SandLand) Pre-evaluating expressions: Especially in games that heavily reference arrays throughout a section of code, it is often good both for speed and memory to pre-evaluate expressions that do not change throughout the loop. Look at this code for drawing a scrolling 16x16 tilemapper with X and Y positions in pixels: For(A,0,7) For(B,0,11) If {Y/8+B*16+(X/8)+A+L1} Pt-On(A*8-(X^8),B*8-(Y^8),{Y/8+B*32+(X/8)+A}*8+Pic0 End End End There is a HUGE speed gain from simply preevaluating some of the expressions before entering the loop:
X/8->E Y/8->F X^8->I Y^8->J For(A,0,7) For(B,0,11) If {F+B*16+E+A+L1}->C Pt-On(A*8-I,B*8-J,C*8+Pic0 End End End ...and also added the thing about Fill(). Man, this thing is getting hard to edit
902
« on: February 03, 2011, 07:54:05 pm »
Thanks. comicIDIOT over at Cemetech has given me some great ideas, so once I get Spoiler for Hidden done, I will begin to work on destructable blocks, blocks with more friction or bounce than others, and collectibles (I don't think it'll be able to manage enemies though) edit: 911! haha
903
« on: February 03, 2011, 07:39:30 pm »
Glad you understand it. Just make sure to initialize the x and y speeds correctly
904
« on: February 03, 2011, 07:38:56 pm »
Builderboy: if you don't feel like it I could write one for you; I just explained it to ruler so I'm kinda in the mood lol edit: actually, it would probably be suitable as a small addition to the first post, about gravity...
905
« on: February 03, 2011, 07:36:01 pm »
Although this isn't a speed-intensive game, isn't it true that 0-> is actually faster (although Delvar is smaller? (but only due to the fact that you can chain commands off of it))?
906
« on: February 03, 2011, 07:31:35 pm »
That's the beauty; you don't have to. Keeping track of the velocities by themselves like that is all you have to do
907
« on: February 03, 2011, 07:23:34 pm »
He did already lol. And IIRC, changing the catalog would be pretty hard. Also, I second the request to have the last-compile program at the top of the screen
908
« on: February 03, 2011, 07:21:44 pm »
I don't know python so I can only kinda explain the process...anyway, what you need first is the angle, and the speed that you want it fired. So let's say we want an angle of 30 degrees at a speed of, say, 5. (I will use BASIC/Axe style syntax here) So, to initialize the speed of the projectile (in variables I'll call xvel and yvel) we will do 5cos30->xvel and 5sin30->yvel.Now, every frame we will change the position of the projectile by the speed of it (makes sense, right? if we are traveling at 5 units per frame the next frame we will have moved by 5). So xpos+xvel->xpos, and ypos+yvel->yposBut the projectile is affected by gravity, right? So whatever our gravity is (let's pretend it's an acceleration of 1 unit per frame) we will need to change the y speed by that value. So yvel-1->yvelNow do this every frame and you can use xpos and ypos as the location of where to draw the projectile Hope this helps Think of the projectile as something that is affected by gravity, but also moves horizontally.
909
« on: February 03, 2011, 07:11:32 pm »
Keep track of the projectiles x and y position as well as the x and y velocity. increment position by velocity every frame, and increase y by gravity every frame (I think you know this already ) When it's fired, the initial x and y velocities should be (finalvelocity)*cos(angle) and (finalvelocity)*sin(angle) respectively
910
« on: February 03, 2011, 07:07:58 pm »
leafiness0:
(New tile value)->{(Yposition of new tile) * (Width of level) + (Xposition of new tile) + (Level data start)}
911
« on: February 03, 2011, 05:57:56 pm »
lol.
912
« on: February 03, 2011, 05:50:52 pm »
... I'll have to take a look at that, though I don't think that anything in the program would cause that (maybe i'm writing one too many bytes into user RAM?)
913
« on: February 03, 2011, 05:41:25 pm »
Update! After much optimizing, I think it now runs FASTER than the original without scrolling . Also, I have fixed the bad collision detection: sometimes you could fall through the floor and such. Additionally, if you get too close to the edge, you will now semi-realistically slip down If you fall really far down, the tiles will still randomly change because you have fallen past the limits of L1 Oh and yeah, I added the character animation. It actually helps me debug the program too
914
« on: February 03, 2011, 05:26:09 pm »
@JustCause: Sure @program4; Nice, I'll try it out when I get some time
915
« on: February 03, 2011, 05:24:26 pm »
Hm, that would be cool, although I'm not sure I'd like to spend all the time getting together all the disassembly resources I'd need.... As a side note, new version is now in archives
Pages: 1 ... 59 60 [61] 62 63 ... 123
|