[QUOTE=Kamern;32375167]You've given the List a generic of <TerrainPiece>, but you've assigned terrainPieces something which cannot possibly exist in TerrainPiece's parameters.[/QUOTE] Wa-ha-hat?
[QUOTE=Funley;32375228]Wa-ha-hat?[/QUOTE]
You're letting terrainPieces access code which isn't applicable to the TerrainPiece class. It's like declaring a variable as a string and putting and integer in it.
[QUOTE=Funley;32373876]What is this error supposed to mean?
[code]Inconsistent accessibility: field type 'System.Collections.Generic.List<NewLand.terrain.TerrainPiece>' is less accessible than field 'NewLand.terrain.Terrain.terrainPieces'
[/code]
I have this which errors:
[code]public List<TerrainPiece> terrainPieces;[/code][/QUOTE]
TerrainPiece probably isn't public
Anyone know how to fix this damn thing?
Error 13 error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in Joystick.obj C:\Documents and Settings\Richy\Desktop\SFML-1.6\build\vc2008\sfml-system-s-d.lib(Clock.obj) sfml-window
Using the 2008 fies of SFML1.6 with 2010
[QUOTE=Richy19;32382857]Anyone know how to fix this damn thing?
Error 13 error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in Joystick.obj C:\Documents and Settings\Richy\Desktop\SFML-1.6\build\vc2008\sfml-system-s-d.lib(Clock.obj) sfml-window
Using the 2008 fies of SFML1.6 with 2010[/QUOTE]
Try SFML 2, I guess. 1.6 isn't currently being supported by developers, afaik.
You are running sfml-system-s-d.lib, which means it's a static debug library. Are you running in Release mode or Debug mode? You should be in debug mode if you're not
[QUOTE=ief014;32382918]Try SFML 2, I guess. 1.6 isn't currently being supported by developers, afaik.[/QUOTE]
Pretty much that. Just skip over 1.6, unless you REALLY have to use it.
[QUOTE=ief014;32382918]Try SFML 2, I guess. 1.6 isn't currently being supported by developers, afaik.
You are running sfml-system-s-d.lib, which means it's a static debug library. Are you running in Release mode or Debug mode? You should be in debug mode if you're not[/QUOTE]
Im building the libraries in VS2010, I havent started using it iin my program yet.
I would use SFML2 but I want to use Spark particle engine (or any other particle engine for that matter) and most of them are only made for stable versions of SFML
I would say SFML 2 works more stable than SFML 1.6, plus the API hasn't changed all too much. It should be little to no hassle to switch.
[QUOTE=ief014;32383307]I would say SFML 2 works more stable than SFML 1.6, plus the API hasn't changed all too much. It should be little to no hassle to switch.[/QUOTE]
Well I tried swaping the Spark SFML renderer over to SFML2 but I just got loads of errors when trying out the samples
[QUOTE=Richy19;32383385]Well I tried swaping the Spark SFML renderer over to SFML2 but I just got loads of errors when trying out the samples[/QUOTE]
Even though the API hasn't changed much, doesn't mean it hasn't changed. Try changed the Spark code?
[QUOTE=T3hGamerDK;32383623]Even though the API hasn't changed much, doesn't mean it hasn't changed. Try changed the Spark code?[/QUOTE]
I didnt try changng the core code, only the renderer and the sample code.
[QUOTE=Zeonho;32378013]TerrainPiece probably isn't public[/QUOTE] Thanks, it works now :)
[QUOTE=DEMONSKUL;32373962]Having trouble in AS3.0, I made an eye following the cursor, it works but it moves freely in the page, and I have to make it so it only moves within an oval. Haven't figure out how yet.[/QUOTE]
Reposting because I still need help....
Since the web development thread can't seem to help me, and since this is more a programming thing than a web development thing, I'll ask here.
In javascript, when you use document.body.appendChild in a onload event, document.body will also be the body of any iframes on the page: such as youtube videos.
Are there any better ways or workarounds to just get the pages body element?
If im trying to do ths:
[img]http://img534.imageshack.us/img534/8454/unledimq.png[/img]
Whereby the player always jumps with a set force (say 5000) but varies the angle to reach different distances.
How would I know how to distibute thhe 5000 force between the X and Y to make the plaer reach the mouse position?
Think of a right triangle where the hypotenuse is the player's velocity vector at the moment of the jump, and the legs are the horizontal and vertical components of that vector. Take the sine and cosine of the jump angle and multiply by the total speed (i.e. the length of the velocity vector) to get the horizontal and vertical speeds.
[QUOTE=Richy19;32402132]If im trying to do ths:
[img]http://img534.imageshack.us/img534/8454/unledimq.png[/img]
Whereby the player always jumps with a set force (say 5000) but varies the angle to reach different distances.
How would I know how to distibute thhe 5000 force between the X and Y to make the plaer reach the mouse position?[/QUOTE]
x = v_initial * cos(theta) * time
y = v_initial * sin(theta) * time - 1/2 * grav_accel * time * time
Set y = 0, solve for theta:
v_initial * sin(theta) * time - 1/2 * grav_accel * time * time = 0
time = 2 * v_initial * sin(theta) / grav_accel
x = 2 * v_initial * v_initial * cos(theta) * sin(theta) / grav_accel
x = sin(2 * theta) * v_initial * v_initial / grav_accel
theta = 1/2 * arcsin(x * grav_accel / (v_initial * v_initial))
I assume grav_accel is positive downwards and for simplicity. Also, I assume the initial and ending positions are both y=0, which works for flat terrain.
Double-check my algebra.
[editline]21st September 2011[/editline]
[QUOTE=Wyzard;32402417]Think of a right triangle where the hypotenuse is the player's velocity vector at the moment of the jump, and the legs are the horizontal and vertical components of that vector. Take the sine and cosine of the jump angle and multiply by the total speed (i.e. the length of the velocity vector) to get the horizontal and vertical speeds.[/QUOTE]
He's asking how to get the player to [i]land[/i] at a specific point.
[QUOTE=ROBO_DONUT;32402484]x = v_initial * cos(theta) * time
y = v_initial * sin(theta) * time - 1/2 * grav_accel * time * time
Set y = 0, solve for theta:
v_initial * sin(theta) * time - 1/2 * grav_accel * time * time = 0
time = 2 * v_initial * sin(theta) / grav_accel
x = 2 * v_initial * v_initial * cos(theta) * sin(theta) / grav_accel
x = sin(2 * theta) * v_initial * v_initial / grav_accel
theta = 1/2 * arcsin(x * grav_accel / (v_initial * v_initial))
I assume grav_accel is positive downwards and for simplicity. Also, I assume the initial and ending positions are both y=0, which works for flat terrain.
Double-check my algebra.
[editline]21st September 2011[/editline]
He's asking how to get the player to [i]land[/i] at a specific point.[/QUOTE]
yea,
Also could you strip that formula out abit? As I am using farseers I dont need to worry about updating the objects possition. I simply apply an X ad Y force to it and let farseer worry about gravity...
What I meant was how would I know how to distribute the 5000 force to the X and Y so that it creates the correct angle to land on a position
[QUOTE=Richy19;32402670]
What I meant was how would I know how to distribute the 5000 force to the X and Y so that it creates the correct angle to land on a position[/QUOTE]
Wyzard already told you how to do that.
You can't do the calculation without knowing gravity, even if your physics engine handles all the kinematics.
[QUOTE=Wyzard;32402417]Think of a right triangle where the hypotenuse is the player's velocity vector at the moment of the jump, and the legs are the horizontal and vertical components of that vector. [b]Take the sine and cosine of the jump angle[/b] and multiply by the total speed (i.e. the length of the velocity vector) to get the horizontal and vertical speeds.[/QUOTE]
But i dont know the jump angle, all I know is the player position, the mouse position, gravity(0,9.8f) and jump force 5000
Is there a way to simplify this with a loop? Compile-time is fine, I just don't want to do it this way.
[cpp]int main(void)
{
fprintf(stdout, "Testing UTF-32...\n");
testUTF<uint32_t, uint32_t>(&testEncs[0], &testEncs[0]);
testUTF<uint32_t, uint16_t>(&testEncs[0], &testEncs[1]);
testUTF<uint32_t, uint8_t> (&testEncs[0], &testEncs[2]);
fprintf(stdout, "Testing UTF-16...\n");
testUTF<uint16_t, uint32_t>(&testEncs[1], &testEncs[0]);
testUTF<uint16_t, uint16_t>(&testEncs[1], &testEncs[1]);
testUTF<uint16_t, uint8_t> (&testEncs[1], &testEncs[2]);
fprintf(stdout, "Testing UTF-8...\n");
testUTF<uint8_t, uint32_t>(&testEncs[2], &testEncs[0]);
testUTF<uint8_t, uint16_t>(&testEncs[2], &testEncs[1]);
testUTF<uint8_t, uint8_t> (&testEncs[2], &testEncs[2]);
fprintf(stdout, "All tests passed.\n");
return 0;
}[/cpp]
[QUOTE=Jookia;32403943]Is there a way to simplify this with a loop? Compile-time is fine, I just don't want to do it this way.
[cpp]int main(void)
{
fprintf(stdout, "Testing UTF-32...\n");
testUTF<uint32_t, uint32_t>(&testEncs[0], &testEncs[0]);
testUTF<uint32_t, uint16_t>(&testEncs[0], &testEncs[1]);
testUTF<uint32_t, uint8_t> (&testEncs[0], &testEncs[2]);
fprintf(stdout, "Testing UTF-16...\n");
testUTF<uint16_t, uint32_t>(&testEncs[1], &testEncs[0]);
testUTF<uint16_t, uint16_t>(&testEncs[1], &testEncs[1]);
testUTF<uint16_t, uint8_t> (&testEncs[1], &testEncs[2]);
fprintf(stdout, "Testing UTF-8...\n");
testUTF<uint8_t, uint32_t>(&testEncs[2], &testEncs[0]);
testUTF<uint8_t, uint16_t>(&testEncs[2], &testEncs[1]);
testUTF<uint8_t, uint8_t> (&testEncs[2], &testEncs[2]);
fprintf(stdout, "All tests passed.\n");
return 0;
}[/cpp][/QUOTE]
Write a macro?
[QUOTE=Jookia;32403943]Is there a way to simplify this with a loop? Compile-time is fine, I just don't want to do it this way.
[cpp]int main(void)
{
fprintf(stdout, "Testing UTF-32...\n");
testUTF<uint32_t, uint32_t>(&testEncs[0], &testEncs[0]);
testUTF<uint32_t, uint16_t>(&testEncs[0], &testEncs[1]);
testUTF<uint32_t, uint8_t> (&testEncs[0], &testEncs[2]);
fprintf(stdout, "Testing UTF-16...\n");
testUTF<uint16_t, uint32_t>(&testEncs[1], &testEncs[0]);
testUTF<uint16_t, uint16_t>(&testEncs[1], &testEncs[1]);
testUTF<uint16_t, uint8_t> (&testEncs[1], &testEncs[2]);
fprintf(stdout, "Testing UTF-8...\n");
testUTF<uint8_t, uint32_t>(&testEncs[2], &testEncs[0]);
testUTF<uint8_t, uint16_t>(&testEncs[2], &testEncs[1]);
testUTF<uint8_t, uint8_t> (&testEncs[2], &testEncs[2]);
fprintf(stdout, "All tests passed.\n");
return 0;
}[/cpp][/QUOTE]
Why are you doing fprintf to stdout? Might as well use printf.
[highlight](User was permabanned for this post ("Alt of permabanned user." - Seiteki))[/highlight]
HTML = Programming language
C++ = Markup language
Lesson learned N00BS!
best posts 2010
Ontopic, I rewrote my bash script to generate a header to pure Python, so hopefully it'll port to Windows easier.
So I made a small program in python where you answer questions and depending on how fast you answreded correctly you get more points. I'm good with all that but i need some help to make a highscore list, tried to do it with writing text into files but i have no clue how to read them and interpret them later. All I need to store is a player name and his/her score, with the highest on top and lowest on the bottom.
In C++, if I were to create and initialise two arrays one after the other, why does the second array get addresses allocated earlier than first one?
In Python 2.7 how would I make a Unicode string? I mean, I can load the same string from a file, but it's just one line.
[QUOTE=Box Eater;32406533]In C++, if I were to create and initialise two arrays one after the other, why does the second array get addresses allocated earlier than first one?[/QUOTE]
You mean multidimensional or just multiple arrays?
Sorry, you need to Log In to post a reply to this thread.