[QUOTE=Dj-J3;30961858]Tried adding the file as a link?
[IMG]http://img809.imageshack.us/img809/6849/screenshot2011070712145.png[/IMG][/QUOTE]
Wow! Thanks, exactly what I wanted. Can't believe I did not see that. I feel so dumb now :rolleyes:
[QUOTE=Felheart;30961843]So they are not only changed by me, but also by people on different PCs.I can't believe nobody has thought of that in the Visual Studio team...[/QUOTE]
It's not that they didn't think of multi-user collaboration, it's that the way you're doing it is unusual. Normally the team would be using a revision-control system like Subversion or Git, so those files can be kept in the solution folder as versioned files. When someone makes a change, they check it in, and you get the change next time you update from the repository.
[QUOTE=Wyzard;30962871]It's not that they didn't think of multi-user collaboration, it's that the way you're doing it is unusual. Normally the team would be using a revision-control system like Subversion or Git, so those files can be kept in the solution folder as versioned files. When someone makes a change, they check it in, and you get the change next time you update from the repository.[/QUOTE]
When working on a larger project, with more than one person for each job (2 programmers or 2 artists)
then revision-control is good and actually needed, I'll agree with you on that.
But I'm working on the project with a friend (2 person team). The project isn't (and never will be) so complex that source control is needed.
I just need live synchronization of the content files, "Add as Link" + LAN folder is perfect for that. :smile:
Required to start learning C++, I enjoy a good book to sit down with and browse over instead of following internet tutorials all the time.
Done a little bit of python and a fair bit of java, so it doesn't need to be an introduction to programming kind of deal.
Any recommendations for such a book?
So I basically want to make a tilebased game in Java, how would I make it tilebased?
Speaking of tilebased games in Java..
I'd like to try a simple version of "If you can't see it, it's black", so only the tiles that aren't blocked by walls are rendered, how would I do that?
Currently I have a 2d array with Tile objects in them. All tiles have an X and a Y coordinate and a solid boolean.
Basically I would want to draw a line from the player to every tile. If the line crosses a solid tile, the end tile would only be black, but I'm not sure how to do it.
Is it possible to get the currently logged in user through VS?
So I could do something like: string something = "this is: " + %user% + "'s copy, do not distribute";
And it would automatically output this is: Richy's copy, do not distribute
C++ if it matters
Should also mention I want it to get the user and then hard code it, so it would always say Richy no matter who uses it.
[QUOTE=Zyx;30967237]Speaking of tilebased games in Java..
I'd like to try a simple version of "If you can't see it, it's black", so only the tiles that aren't blocked by walls are rendered, how would I do that?
Currently I have a 2d array with Tile objects in them. All tiles have an X and a Y coordinate and a solid boolean.
Basically I would want to draw a line from the player to every tile. If the line crosses a solid tile, the end tile would only be black, but I'm not sure how to do it.[/QUOTE]
You already described how to do it. The rest is implementation specific.
You probably want to learn about the [url=http://en.wikipedia.org/wiki/Bresenham_line_algorithm]Bresenham line algorithm[/url]. A trivial adjustment to the algorithm allows it to create continuous lines instead of doing diagonal jumps every now and then if that's desirable.
The naive way to do it is exactly as easy as you just described - draw lines to every potentially visible tiles. If any of the line's pixels is solid, the tile won't be visible. If you don't need high performance, that should suffice just fine.
However if you want better performance, I made a tiered ray caster once and I think I still have the math somewhere. Though that was designed for thousands of tiles.
Another way to improve it would be caching the intermediary values. The closer a tile is, the more often you'll be tracing a line through it. So cache the result of the trace and when you next time run into the tile, you already know whether it blocks visibility.
[QUOTE=ThePuska;30968863]You already described how to do it. The rest is implementation specific.
You probably want to learn about the [url=http://en.wikipedia.org/wiki/Bresenham_line_algorithm]Bresenham line algorithm[/url]. A trivial adjustment to the algorithm allows it to create continuous lines instead of doing diagonal jumps every now and then if that's desirable.
The naive way to do it is exactly as easy as you just described - draw lines to every potentially visible tiles. If any of the line's pixels is solid, the tile won't be visible. If you don't need high performance, that should suffice just fine.
However if you want better performance, I made a tiered ray caster once and I think I still have the math somewhere. Though that was designed for thousands of tiles.
Another way to improve it would be caching the intermediary values. The closer a tile is, the more often you'll be tracing a line through it. So cache the result of the trace and when you next time run into the tile, you already know whether it blocks visibility.[/QUOTE]
I did experiment a bit with that earlier with a recursive, although my version never really did hit the player tile, but always one of the sides, thus going offgrid.
Before you posted this I used a simple algorithm if you could even call it that:
If the tile on the same horizontal OR vertical line?
Go one tiler closer to the player tile until you hit the player tile.
If not, it would just check one tile diagonally closer to the player tile.
TpTTTTT
T*TTTTT
T*TTTTT
TT*TTTT
TTT*TTT
Sorta like that. It works, but it's hardly perfect :v:
[thumb]http://i52.tinypic.com/jhzia8.jpg[/thumb]
Now I just need to make the tiles next to a visible one half visible or something.
And I'll see if I can get that algorithm working later.
If i want something black, meaning that nothing is rendered there, i just draw a full-screensized black rectangle, and not move that with the other object, though im not fully sure if you mean that, or if it even works tilebased.
Does anyone know what this is about?
[img]http://img94.imageshack.us/img94/691/unledtoik.png[/img]
the code is
[code]
...
image.Draw(text);
displacement += 10;
app.Draw(sf::Shape::Rectangle(5,5,120,displacement, sf::Color(255,255,255, 0), 2, sf::Color::Black));
image.Display();
sf::Sprite sprite = sf::Sprite(image.GetImage(), sf::Vector2f(5.f,5.f),sf::Vector2f(1.f,1.f), 0.0f, sf::Color::White);
sprite.SetSubRect(sf::Rect<int>(10,10,120,displacement) );
app.Draw(sprite);
[/code]
And the main problem is the sprite setSubRect,
if i comment that out then it displays the text fine, all be it bigger than I want, if i have it there then nothing displays and I get that error on closing.
image is an SF::RenderImage
I need some help drawing a heptagon (seven edges). I've tried everything (this)
-snip-
[b]Edit[/b]
Oh shit never mind, I used Degrees instead of Radians
[QUOTE=Woodcutter11;30971775]Oh shit never mind, I used Degrees instead of Radians[/QUOTE]
I've lost count the number of times I've made that mistake.
I'm writing a TTF file parser and have bumped into a little problem, I am reading it into a Byte array but the content seems rather different from what I see in a hex editor.
[code]file = new FileInputStream("DroidSans.ttf");
final int size = file.available();
data = ByteBuffer.allocateDirect(size);
System.out.println("File opened containing " + file.available() + " bytes");
final byte tmp[] = new byte[size];
file.read(tmp);
for (int i = 0; i < size; i += 2)
{
System.out.printf("%02x ", tmp[i]);
}[/code]
And the output (first 10 bytes):
[code]
Program: 00 00 00 01 00 00 46 54 51 33 00
Editor: 00 01 00 00 00 12 01 00 00 04 00
[/code]
Anyone have any idea what is causing this ?
Bah I am having so much trouble with setting up Git
So far its a pain in the ass
Can anyone help me or give me a link to a good Git Tutorial?
[URL]http://gitref.org/[/URL]
I just tried using git commit -m "Take my commit"
And it didn't output what the tutorial said
[IMG]http://gyazo.com/48bf93353ab3175192b9a05c4af3a76d.png[/IMG]
follow the guide again, and don't skip shit
[QUOTE=Doritos_Man;30974009]Bah I am having so much trouble with setting up Git
So far its a pain in the ass
Can anyone help me or give me a link to a good Git Tutorial?[/QUOTE]
Windows, Linux or Mac? And if Windows, then what git software are you using?
[QUOTE=T3hGamerDK;30974724]Windows, Linux or Mac? And if Windows, then what git software are you using?[/QUOTE]
I am using msysgit
[url]http://code.google.com/p/msysgit/[/url]
[QUOTE=Doritos_Man;30974009]Bah I am having so much trouble with setting up Git
So far its a pain in the ass
Can anyone help me or give me a link to a good Git Tutorial?[/QUOTE]
I used this one to learn git a while back.
[URL="http://book.git-scm.com/"]http://book.git-scm.com/
[/URL]
As for your problem, you need to stage the changes in your repository before committing.
You would do
[code]
git add gitolite-admin
git commit -m "TAKE MY COMMIT"
[/code]
However, git has an option to do this in one command.
[code]
git commit -a -m "TAKE MY COMMIT"
[/code]
The -a option automatically stages any file that was changed since the previous commit. You can just skip the git add part basically.
which is mentioned in the guide I linked to and he would have seen that unless he had skipped directly to committing
[QUOTE=thelinx;30975095]which is mentioned in the guide I linked to and he would have seen that unless he had skipped directly to committing[/QUOTE]
Thanks for all the help I got commiting and pushing working
Time to figure out merging and other things
[QUOTE=Chryseus;30972556]I've lost count the number of times I've made that mistake.
I'm writing a TTF file parser and have bumped into a little problem, I am reading it into a Byte array but the content seems rather different from what I see in a hex editor.
[code]file = new FileInputStream("DroidSans.ttf");
final int size = file.available();
data = ByteBuffer.allocateDirect(size);
System.out.println("File opened containing " + file.available() + " bytes");
final byte tmp[] = new byte[size];
file.read(tmp);
for (int i = 0; i < size; i += 2)
{
System.out.printf("%02x ", tmp[i]);
}[/code]
And the output (first 10 bytes):
[code]
Program: 00 00 00 01 00 00 46 54 51 33 00
Editor: 00 01 00 00 00 12 01 00 00 04 00
[/code]
Anyone have any idea what is causing this ?[/QUOTE]
i += 2 is causing that.
Also, file.available() only returns an estimate as it seems, so check for EOF after you've read from the file. And perhaps check the returned value from file.read(tmp).
C++
Hi, I need to delete the last char of a stringstream . Any tips ?
Edit: solved :)
Alright, I give up. I cannot load images unless I open it from inside Netbeans, which kinda sucks.
Source files:
\TileWorld\src\*Folder name*\*Filename*.java
Image files:
\Tileworld\Images\*Imagename*.png
How would I load images to a BufferedImage where it also works when opening the .jar file?
Edit:
Well, I think it works now.. But same problem when loading files to a Scanner to read the file. The same method as before doesn't work, unless I run it from Netbeans.
I draw Images by doing
[cpp] Image test;
ImageIcon test = new ImageIcon("Images\theimage.jpg").getImage();
public void drawBuffer(){
g.drawImage(test,0,0,null);
}
[/cpp]
Now, the image should be located in (.jar\src\*Folder name*\Images\)
Atleast, that's how I did it, and I think it worked. Hope this helps
I'm trying to get into XNA and I'm following this tutorial:
[url]http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series2D/Drawing_fullscreen_images.php[/url]
Which was going fine until I got to this part:
[img]http://www.riemers.net/images/Tutorials/XNA/Csharp/Series2D/chap2-3.jpg[/img]
It tells me I need to add the pictures to the "Content" folder, but I don't have one.
Instead, I have this.
[img]http://i.imgur.com/QoiAF.png[/img]
Using this content folder doesn't work, I tried adding the pictures there anyways and the code can't find them.
Try as I might, I can't find anything on how to solve this.
Anybody?
[QUOTE=HyyperVyyper;30991830]I'm trying to get into XNA and I'm following this tutorial:
[URL]http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series2D/Drawing_fullscreen_images.php[/URL]
Which was going fine until I got to this part:
[IMG]http://www.riemers.net/images/Tutorials/XNA/Csharp/Series2D/chap2-3.jpg[/IMG]
It tells me I need to add the pictures to the "Content" folder, but I don't have one.
Instead, I have this.
[IMG]http://i.imgur.com/QoiAF.png[/IMG]
Using this content folder doesn't work, I tried adding the pictures there anyways and the code can't find them.
Try as I might, I can't find anything on how to solve this.
Anybody?[/QUOTE]
Add them to the root of the XNATutorialContent project, then load them in code
[cpp]Texture2D background = Content.Load<Texture2D>("FilenameWithoutExtension");[/cpp]
[QUOTE=Dj-J3;30992158]Add them to the root of the XNATutorialContent project, then load them in code
[cpp]Texture2D background = Content.Load<Texture2D>("FilenameWithoutExtension");[/cpp][/QUOTE]
[img]http://i.imgur.com/YfciV.png[/img]
I tried that before. That line of code sprung me back an error.
[QUOTE=HyyperVyyper;30992315][img]http://i.imgur.com/YfciV.png[/img]
I tried that before. That line of code sprung me back an error.[/QUOTE]
Where are you calling the Load method?
Sorry, you need to Log In to post a reply to this thread.