Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Fuv

Pages: [1]
1
General / Connecting scrolling map and collisions
« on: June 17, 2010, 02:54:12 pm »
Hello all :)

I made successful my scrolling map and collisions, but when I tried to connect it - sth was wrong.

http://wklej.to/v46L

I am wondering whats wrong, becouse without map scrolling, collisions were workin'.

Kind Regards
Fuv

2
General / Scrolling map
« on: June 13, 2010, 05:16:34 pm »
Hello all again,
Unfortunately I have next trouble - now with moving map. I wrote code on two ways and both is not working :(

I need your help then.

My first effort was using this post:
http://www.sfml-dev.org/forum/viewtopic.php?p=5097&sid=f9a1cd64f563b420ac67e1e42a2e2f99

And what I made is:
http://wklej.to/TnAa

And then I tried to do sth myself, but ofc it also doesn't work:
http://wklej.to/f8Nz
Here I even don't see a map :o

Is here somebody willing to help me?

Kind Regards
Fuv

3
General / Collision - example(?)
« on: June 09, 2010, 04:46:31 pm »
I read about collision at wiki:
http://www.sfml-dev.org/wiki/en/sources/simple_collision_detection
I added that class to my program, but I dont know how to use it at all. There isnt any example...

I have two Sprites - Object and Bar. And now how to set collision?

I wrote code:
Code: [Select]
if(Collision::BoundingBoxTest(Object, Bar))
   {
return 0;
   }

and nothing happens. Why?

Kind Regards
Fuv

4
General / Slow moving of sprite with background
« on: June 04, 2010, 02:01:40 pm »
I have such code:

Code: [Select]
#include <SFML/Graphics.hpp>

using namespace sf;


int main()
{
RenderWindow App(VideoMode(800, 600, 32), "Game", Style::Fullscreen);

sf::Image IMGBackground, IMGLudzik;

if(!IMGBackground.LoadFromFile("back.jpg"))
return 1;
if(!IMGLudzik.LoadFromFile("lud.png"))
return 1;



Sprite Background(IMGBackground);
Sprite Ludzik(IMGLudzik);

Background.SetPosition(0.f, 0.f);
Background.Resize(800, 600);

Ludzik.SetPosition(200.f, 100.f);
Ludzik.SetScale(1.f, 1.f);


Event evt;

while(App.IsOpened())
{
while(App.GetEvent(evt))
{
if(evt.Type == Event::Closed)
App.Close();
if(evt.Type == Event::KeyPressed && evt.Key.Code == Key::Escape)
App.Close();
}

float time = App.GetFrameTime();
if(App.GetInput().IsKeyDown(Key::Down))
Ludzik.Move(0, 100 * time);
if(App.GetInput().IsKeyDown(Key::Left))
Ludzik.Move(-100 * time, 0);

App.Clear();
App.Draw(Background);
App.Draw(Ludzik);
App.Display();
}
}


But its working really slow and not fluently. I read that I should use class or something as it was said in this tutorial:
http://sfml-dev.org/tutorials/1.6/graphics-sprite.php
about sprite management, but I dont know how to use it in practice. Might somebody tell me how to change the code?

Kind Regards
Fuv

5
General / sf::Image is too big?
« on: June 03, 2010, 07:45:01 pm »
I was trying to add image as a background, but I noticed some images couldnt be loaded even I have the same code. Is it possible to load big image? I have code:

Code: [Select]
sf::Image Background;
if(!Background.LoadFromFile("back.jpg"))
return 1;


And its working for some images and for others not. Is the reason that they are too big(i mean too heavy - over 2MB for example)? If so how to load such a image?

Kind Regards
Fuv

6
Now I started making Window. I added necessary libs to linker output: sfml-window.lib and it compiles and links good, but after running I got msg:
Code: [Select]
Run-Time Check Failure #2 - Stack around the variable 'App' was corrupted.

I dont know what is going on. I read that its my code fault, but I copied it from tutorial:
Code: [Select]
#include <SFML/Window.hpp>

int main()
{
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");

}


And error is becouse of the line in main(), becouse if i put it into comment program works good(doing nothing but works)

Kind Regards
Fuv

7
General / [SOLVED]No sfml-system.dll found?
« on: May 28, 2010, 02:54:07 pm »
Hello all,
I am trying to make my first app with SFML. I have been using this tutorial to Visual C++ 2008:
http://www.sfml-dev.org/tutorials/1.6/start-vc.php

I ve done:
-Go to the Tools / Options menu, then to Projects and Solutions / VC++ Directories and in the Include files, add SFML\include and in Library files, add SFML-\lib
-Copy the code from the site
-Linker / Input item/Additional dependencies/sfml-system.lib.
And I also copied all DLL and BIN files to the folder named lib in Visual C++.

And I got message(translated from Polish by me):
Code: [Select]
This application has failed, becouse no sfml-system.dll file has been found. Reinstalling the application may fix this problem

How to solve the problem?

Kind Regards
Fuv

//edit:
Just I had to put all dlls and bins into folder where .exe file of my program is.
Kind Regards

Pages: [1]