I've been going through my head and umm,
Lets say I had a level design in a PNG format thats so many pixels long and tall. This level has floors and barriers. Representing these by a grid would be complicated and limited in ability, so what if I determined the clipping through vector/graph functions?
Lets say I have a level with a slope.
Y
|
0_______________ X
|-------------------B\
----------------------\
-----------------------\
------------------------\________________________
A
So have select case statements with X as the subject. And there are pre determined points accross the X Axis. The variables are X, Y, A, B and Velocity.
So
(Pseudo Code)
select x
case >= 0 && < B then
y = 1
case >= B && < A then
y = -2X (or Something
etc
Now I have a character in a box thats 200x200px and the movement animations are limited to within this box. Whose point of 'solidity' is in the bottom-middle.
So if X == objectInPath
velocity = 0
B, A would really be put into an array for easier coding and less memory usage.
I can see one possible glitch is that a wrong placement for the greater than signs might cause the character to float in mid air. But the effect should be negated once the character moves another pixel due to the nature of the graphing equations? This method wouldn't allow any multi-level story designs without more if statements to determine what pixel amount counts as a story.
Comments please?
Lets say I had a level design in a PNG format thats so many pixels long and tall. This level has floors and barriers. Representing these by a grid would be complicated and limited in ability, so what if I determined the clipping through vector/graph functions?
Lets say I have a level with a slope.
Y
|
0_______________ X
|-------------------B\
----------------------\
-----------------------\
------------------------\________________________
A
So have select case statements with X as the subject. And there are pre determined points accross the X Axis. The variables are X, Y, A, B and Velocity.
So
(Pseudo Code)
select x
case >= 0 && < B then
y = 1
case >= B && < A then
y = -2X (or Something
etc
Now I have a character in a box thats 200x200px and the movement animations are limited to within this box. Whose point of 'solidity' is in the bottom-middle.
So if X == objectInPath
velocity = 0
B, A would really be put into an array for easier coding and less memory usage.
I can see one possible glitch is that a wrong placement for the greater than signs might cause the character to float in mid air. But the effect should be negated once the character moves another pixel due to the nature of the graphing equations? This method wouldn't allow any multi-level story designs without more if statements to determine what pixel amount counts as a story.
Comments please?