﻿ Latest contributions of: Emerov
18 June, 2013, 10:22:17
 OmnomIRC You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

 Show Contributions Pages: [1]
1  Calculator Community / Axe Language / Scaling Vectors Help on: 05 June, 2012, 03:40:29
OK, so I have a golf-ish game where there is a ball that moves around the screen with separate x and y velocities which vary based on an angle chosen before the ball is hit. This all works perfectly fine, the ball bounces off the walls, etc. But when I try to apply friction to the ball's movement, I encounter some issues.

The process I am using to scale down my velocity vector while maintaining the same angle of motion is as follows:
1. Find the magnitude of the vector
2. Normalize the vector
3. Decrease the value of the magnitude by a friction constant
4. Multiply x and y velocity components by the new magnitude
My code looks like this:
 12345678910111213141516 .PUTTPUTTP*16**cos(θ)->V             //P represents power, used to determine how fast the ball will moveP*16**sin(θ)->W             //V is the X-velocity; W is the Y-velocityRepeat getKey(15) Pt-On(X+V->X/256, Y+W->Y/256, Pic0)     //X and Y are the position components 127*W//sin(tan-1(V,W))->M               //M is the magnitude of the velocity vector M-F*W//M->W                //F is the friction constant. I multiply the new magnitude by each component before dividing by the current magnitude  M-F*V//M->V                //because W//M would give a value of 0 If X/256>90  -V->V End If Y/256>59  -W->W End DispGraphClrDrawEnd

Depending on P and θ, the code may or may not work, and I can't figure out why; the ball does seemingly random stuff, often not even going in the right direction.
Also, I don't know if this is relevant, but when I debugged the magnitude, it changed whenever the ball bounced off the left or right of the screen, which I don't think should be happening.
Can anybody help me fix this?
2  Calculator Community / Axe Language / Using tokens and strings together on: 20 April, 2012, 09:07:40
I'm attempting to access arbitrary OS vars from the calculator, and subsequently delete them. The code works with programs, groups, appvars, and letters, but whenever I try to access the vars represented by tokens, it does not work properly. Basically, I copy the randomly selected var name over into another string so that I can delete it, but the string doesn't seem to recognize the tokens following the first one. Here is my code (simplified):
 1234567891011121314151617 .DELSUB2Fix 5"var "->Str3"ABCDEFGHIJKLMNOPQRSTUVWXYZØ"->Str5"L1L2L3L4L5L6"->Str6"  "->Str8sub(LSD)ReturnLbl LSD                             //This will only ever delete L1. If the randomly selected number is not 0, then nothing will happenCopy(rand^6*2+Str6,Str8,2)DelVar Str8ReturnLbl ABC                             //This worksCopy(rand^27+Str5,Str3+1,1)DelVar Str3

Is there a way to get around this lack of string support for tokens? Like, can these variables be accessed via hex code or something? Thank you!
 Pages: [1]