• What do you need help with? Version 1
    5,001 replies, posted
[QUOTE=ZeekyHBomb;27026222][cpp] float temp = a.Bottom - b.Top; if(temp <= 0) return; //a.bottom lies over b.top float dy = a.Top - b.Bottom; if(dy >= 0) return; //b.bottom lies over a.top if(-temp < dy) dy = temp; //selects the smaller dy[/cpp] If the original algorithm was okay, this should do it. You should probably just write a few examples down on paper to see if it'd take the right branches.[/QUOTE] Hmm... still nothing happening. I'll get cracking and find out if it's a problem on my part.
I just saw a program called "Key Scrambler" [url]http://www.qfxsoftware.com/index.html[/url] Any idea how I could go about doing this? C#
[QUOTE=yakahughes;27024566][url]http://www.amazon.com/Art-Computer-Programming-Fundamental-Algorithms/dp/0201896834/ref=sr_1_2?ie=UTF8&qid=1293547308&sr=8-2[/url] And the rest of the series. There are none better if you can understand them.[/QUOTE] Reading that book to learn how to program is like driving a Ferrari to learn to ride a bike.
[quote]The program can't start because sfml-window.dll is missing from your computer. Try reinstalling the program to fix this program.[/quote] I'm trying to use sfml. I looked up on the website, and I think I need to compile a solution. When I did, there was 4 failed, so it still doesn't work. If I only knew where Visual C++ 2008 was looking for the dll's. (I haven't really used C++ before, all my programming skills are from Flash.) Does anyone know what I could do?
I have always wanted to make a program that was just an explorer type window that would connect to my VPS automatically and act as a drag and drop storage area. I am new to programming and figured it would be a good project to begin with. I have no idea what language I should do this in or if using ftp would be correct. Any one have any tips on where to begin and what language would be best to use?
[QUOTE=Loli;27034539]I just saw a program called "Key Scrambler" [url]http://www.qfxsoftware.com/index.html[/url] Any idea how I could go about doing this? C#[/QUOTE] It seems to be some kind of driver or something similar that returns correct data to all input areas, but wrong data to WinAPI functions that are used for keylogging.
[QUOTE=no-named;27037285]I'm trying to use sfml. I looked up on the website, and I think I need to compile a solution. When I did, there was 4 failed, so it still doesn't work. If I only knew where Visual C++ 2008 was looking for the dll's. (I haven't really used C++ before, all my programming skills are from Flash.) Does anyone know what I could do?[/QUOTE] You need to copy the SFML dlls to the same directory as your executable.
[QUOTE=raBBish;26851895]You can't know that T is a type with rect and collisionDetectionData fields. If they're defined in an interface or a parent class, you can do this: [csharp]public Boolean intersectPixels<T>(ref T myReference) where T : SomeClass[/csharp] If they're defined in only one class, I don't see any reason to use generics there. [editline]21st December 2010[/editline] Also, why are you using ref?[/QUOTE] Came back to this, i ended up having [csharp]public Boolean solidsIntersects(Player something) { Vector2 possiotionOnMap; possiotionOnMap.X = something.position.X / 32; possiotionOnMap.Y = something.position.Y / 32; Console.WriteLine("x: " + possiotionOnMap.X + "y: " + possiotionOnMap.Y); return false; } public Boolean solidsIntersects(entity something) { //something return false; }[/csharp] as i cant do [csharp]public Boolean intersectPixels<T>(ref T myReference) where T : SomeClass and SomeClass2[/csharp] That works fine for me but if you cant do the later example why would you need generics? why not just do what i did in the first place
[QUOTE=Richy19;27051243]That works fine for me but if you cant do the later example why would you need generics? why not just do what i did in the first place[/QUOTE] [csharp]public Boolean intersectPixels<T>(ref T myReference) where T : SomeClass[/csharp] That means T has to be a class derived from SomeClass. It could work if your entities have a shared parent class or interface (Entity, IEntity, BaseEntity or something like that), which declares the members and methods you need to use in the function.
Ahh i see Also is it possible to have a Console window AND an XNA Window? so i can write to console from my XNA Game?
Trying to get SFML2 working, but I get errors I can't find a solution to when I build my program: [code]/usr/local/lib/libsfml-window.so||undefined reference to `XRRConfigCurrentConfiguration'| /usr/local/lib/libsfml-window.so||undefined reference to `XRRSetScreenConfig'| /usr/local/lib/libsfml-window.so||undefined reference to `XRRFreeScreenConfigInfo'| /usr/local/lib/libsfml-window.so||undefined reference to `XRRGetScreenInfo'| /usr/local/lib/libsfml-window.so||undefined reference to `XRRConfigSizes'| ||=== Build finished: 5 errors, 0 warnings ===| [/code] The compile and install of sfml2 seemed to go fine. I don't understand why I can't compile my test program.
[QUOTE=Richy19;27051493]Ahh i see Also is it possible to have a Console window AND an XNA Window? so i can write to console from my XNA Game?[/QUOTE] Just make the game make the console and manage it from there.
[QUOTE=commander204;27053863]Just make the game make the console and manage it from there.[/QUOTE] Thats what i dont know how to do. Is there a console class?
What's the best way of going about a multi-layered background in a 2d game? I'm thinking having like 2 layers of background, one bigger than the other. The smaller one is in the back and moves little, while the one in front of it moves more.
[QUOTE=Richy19;27054074]Thats what i dont know how to do. Is there a console class?[/QUOTE] Not in the way you want it, I think your best bet is to make a new form in that form simply add a textentry(if you want console commands) and a textbox, then send a message to the form from the game, etc...
I just updated SFML 2 and for some reason when I run my game now I get "vector iterator not dereferencable". I set up breakpoints over the areas that use ANY vector what so ever, but no dice, it crashes after wards. I have no idea where to look. Any hints on where to set up breakpoints? Also, does SFML 2 now work with the latest ATi drivers?
Doesn't the debugger intercept the crash so you can look at the stack 'n shit?
[QUOTE=Mattz333;27052511]Trying to get SFML2 working, but I get errors I can't find a solution to when I build my program: [code]/usr/local/lib/libsfml-window.so||undefined reference to `XRRConfigCurrentConfiguration'| /usr/local/lib/libsfml-window.so||undefined reference to `XRRSetScreenConfig'| /usr/local/lib/libsfml-window.so||undefined reference to `XRRFreeScreenConfigInfo'| /usr/local/lib/libsfml-window.so||undefined reference to `XRRGetScreenInfo'| /usr/local/lib/libsfml-window.so||undefined reference to `XRRConfigSizes'| ||=== Build finished: 5 errors, 0 warnings ===| [/code] The compile and install of sfml2 seemed to go fine. I don't understand why I can't compile my test program.[/QUOTE] Link with X and Xrandr
I have a small problem, its more trigonometry than programming [img]http://img412.imageshack.us/img412/3815/23534052.png[/img] So i have a player image and the sprite isnt in the center, the gun is. I can change the center its self so i need to know the position of the center of my guy. However this of course will change depending on the rotation of my guy so, i need to know how to figure that out
Cx = offset to centre of your guy from the centre of the sprite (x direction) with no rotation. Cy = offset to centre of your guy from the centre of the sprite (y direction) with no rotation. C'x = offset after rotation (x). C'y = offset after rotation (y). C'x = Cx*cos(angle) - Cy*sin(angle) C'y = Cx*sin(angle) + Cy*cos(angle) You may need to change the signs depending on your coordinate system. -edit- By the looks of it your original y offset is 0, so just ignore the Cy's.
[QUOTE=Richy19;27072666]I have a small problem, its more trigonometry than programming [img_thumb]http://img412.imageshack.us/img412/3815/23534052.png[/img_thumb] So i have a player image and the sprite isnt in the center, the gun is. I can change the center its self so i need to know the position of the center of my guy. However this of course will change depending on the rotation of my guy so, i need to know how to figure that out[/QUOTE] It's pretty simple. Just add the sine of the sprite's angle multiplied by the amount you want to move it to its X position, and cosine to its Y position. I might have that backwards, but I think that's all you need to do. [editline]30th December 2010[/editline] Ninjad!
automerge.
[QUOTE=ZeekyHBomb;27070095]Doesn't the debugger intercept the crash so you can look at the stack 'n shit?[/QUOTE] No it just says Debug Assertion Failed! Program: Blah Blah Blah File:Blah Blah/include/Vector Line 70. It opens up file free.c, which is about freeing heap stacks (after the crash in the IDE). I put a break point before a function and then right at the start of that function. It triggers the break point BEFORE the function, but crashes right after, without triggering the other break point.
That pretty much looks like the debugger intercepted it, so you should take a look further down the call stack.
-snip i can figure this out myself-
[QUOTE=WTF Nuke;27077925]No it just says Debug Assertion Failed! Program: Blah Blah Blah File:Blah Blah/include/Vector Line 70. It opens up file free.c, which is about freeing heap stacks (after the crash in the IDE). I put a break point before a function and then right at the start of that function. It triggers the break point BEFORE the function, but crashes right after, without triggering the other break point.[/QUOTE] Switch to the call stack tab and go back to a function in your own code.
Thanks guys I am really pretty new to debugging well. It seems it's because of SFML 2 again. It blows up when I try to draw the text :(. [editline]30th December 2010[/editline] Yeah others are having a problems as well.
I'm not very good at c++ and these fucking pointers are hard to get a grip on, I pass the reference of a int[2] onto a function that takes the reference and changes [1] and [2] but when I run it, it tells me that I "cannot convert parameter 1 from 'int (*)[2]' to 'int *" I don't understand why this is a problem since the pointer only holds the reference to the variable(I think, but I bet this is wrong) Here's the code: [code] void getSizeREF(int* ref){ int* change; change = ref+1; *change = length; change++; *change = height; } //Later in the code: int arr[2]; testCube.getSizeREF(&arr); std::cout << arr[1]; std::cout << arr[2]; [/code] Help a dabbling programmer Facepunch! What was the c++ bbcode again?
[QUOTE=FPSMango;27084933] [code] void getSizeREF(int& ref){ int* change; change = ref+1; //what does this mean?, do you mean ref[1]; ? change = length; change++; change = height; } //Later in the code: int arr[2]; testCube.getSizeREF(arr); std::cout << arr[0]; std::cout << arr[1]; [/code] [/QUOTE] try that, not that im any better at them
[QUOTE=Richy19;27085106]try that, not that im any better at them[/QUOTE] About do you mean ref[1]; As far as I've learnt, an array is just a address that is put in front of the actual variables it contains(That sounded weird on paper but I think I get it in my head) so adding 1(adding 8 bitwise to the address since an int is 8 bytes long?) to the address of the array will be the equivalent of arr[0] and if I then add 1 to the address of arr[0] i get arr[1] and so forth. And no it didn't work unfortunetly. The problem isn't what goes on there. The problem is that the compiler doesn't like that i pass the address of a int[2] to a pointer of type int. But I don't know enough c++ to know how to make a pointer to fit unfortunetly.
Sorry, you need to Log In to post a reply to this thread.