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 - aNewHobby

Pages: 1 [2]
16


I have been trying to build a SFML version of Tetris using c++ as a project to help my learning process. Everyone says that it is a great starting point.

Anyway, I have kind of got a semi working prototype using arrays, one cell for each block, a number of blocks for each peace, a simple test to see if a cell is filled or not for collision. Then I was looking through the forum and I saw this post

http://en.sfml-dev.org/forums/index.php?topic=6992.msg46217#msg46217
Just a suggestion, but if you used sf::Rect's instead of vectors, you could reduce your code down to like 2 lines.


if(ballRect.Intersects(paddle1Rect) return PADDLE1HIT;
if(ballRect.Intersects(paddle2Rect) return PADDLE2HIT;

doe this mean the primitive squares and stuff have their own collision detection functions built in? Would this be usabe.. say using them and overlaying fancy sprites ontop or something?

17
Window / Possible to have transparecy though to desktop?
« on: May 06, 2012, 01:25:14 pm »
Is there a way to have the entire window itself have transparency ? I have been playing with a splash screen using the none options so no resize or close or anything, maybe it might even it might turn into a updater that can use the network stuff to check the net for a update or something b4 the app launches. Anyway I am sure you know the thing i am talking about a splash screen that is transparent though to the desktop.

Can this be done in SFML? I know how to use transparency in images.. but not in the render window itself.

18
General / [SOLVED] - cmake issue - Ubuntu - SMFL2-Snapshot
« on: May 04, 2012, 10:39:57 am »
I am getting this error.. any ideas?

Quote
cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=TRUE .
-- The CXX compiler identification is unknown
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error at cmake/Config.cmake:62 (message):
  Unsupported compiler
Call Stack (most recent call first):
  CMakeLists.txt:20 (include)


-- Configuring incomplete, errors occurred!

I was following the tutorial here...
http://sfmlcoder.wordpress.com/2011/08/16/building-sfml-2-0-with-make-for-gcc/

And have all the libraries installed and have run all the apt-get stuff from this page....

19
General / SFML and video?
« on: May 03, 2012, 08:41:13 am »
Dose SFML support video at all? Alpha mats on videos to mask areas stuff like that?

20
Well... it is assessment time at UNI and here is my new game!! Woot-a-loot-a-lot!!!

This is a Pac-Man Clone called NOM!.... hope you guys like it.. as before this is a windows binary but I will eventually make a Mac and Linux version as I have time.. I am in the middle of assessments at the moment so not much time unfortunately.

I'm pretty happy with this one there are some small problems still and it isn't very memory efficient and lacks some polish but as a learning project I think it came out pretty well in the few weeks we had to work on it.

Big thanks again to the various people who hang in IRC and are foolish enough to speak tor me!

As with all our assignments we are required to make a "Rolling Demo" so here it is.. though They always look kinda lame to me..



Nom! V1.1 (Windows)

Source @ BitBucket - (Warning a fucking mess)

=====================================================================

Ok I'm back... well I nvr left.. big thanks to the forum members as well as though foolish enough to respond when I spoke in IRC. I couldn't have done this with out you all.

This is my 2nd ever program I have ever written and I think it came out really well considering. This is a assessment to hand in for marks, and I have 2 other assessments for other subjects due and just have to call it quits here bugs and all.

Still check it out and any comments would be welcome.  I used Thor Animation for all the animations btw.

ArkBreaker (windows), (linux)


This should be cross platform and I plan to build a Unix (ubuntu) and a Mac version when I get time after my mid term assessments are all done.

Anyway.. bit thanks to those that helped and I'll see you for Assessment 3... witch I already know what it will be... a Pac-Mac clone!

See ya!!

Oh part of the Assignment was to make a rolling demo.. so here it is!



=====================================================================

Hi there.

I have been learning programming recently. Been at it about 6 weeks now slowly working though some book from amazon, some PDFs I was given, google, http://cplusplus.com, http://en.cppreference.com/w/ and ##C++-Basic@freenode.

I tell you this so you understand I am a beginner, as in a real beginner I hadn't programmed a line of code in my life until a little over a month ago. I feel I have done pretty well..

There is still a occasional bug that crashes it but I feel that fixing this one bug is not a major concern,  for me as I'm not trying to produce anything just learn. The project got a little out of hand for me and the once neat code block design degenerated into a real mess. I feel that if i trashed it all and started again I would do a lot better, including range checks on my vector accesses.. witch is the error here, and going though and putting them all in is not teaching me anything but a exercise.

I feel I will be better served by trying to incorporate my lessons into my new project rather than "fix" up this one.

Still I had a lot of fun and SFML once I got it kinda working was a real nice way to add some spice to the game. I intend to keep using it for my next project witch will be a similar simple type of thing but this time I will use 2D gfx powered by SFML!

--== Download == --
http://www.mediafire.com/download.php?bopbkhrxknipte0 (PC ONLY)

If you get a DLL error you may need to install
Microsoft Visual C++ 2010 Redistributable Package (x86)

Or
Microsoft Visual C++ 2010 Redistributable Package (x64)


Again, thanks for the help of those on this forum and I'll chat to you all again soon!

--aNewHobby

21
Audio / Sound Class help please
« on: April 19, 2012, 10:38:35 am »
Hi, I am a new at programming.. I hope you can help such simple questions :) Oh well we all gotta start somewhere.

I know this isn't working.. and IU have tried many other thigns. this code is ment to explain what I want to do with it or how I think it should work...

#ifndef SFX_H
#define SFX_H

#include <SFML/Audio.hpp>
#include "GeneralHeaders.h"

class sfx{
        sf::Sound sfxERROR;
        sf::Sound sxfHIT;
        sf::SoundBuffer Buffer;
public:
        sfx();
        void sError();
        void sHit();
};

#endif
 


#include "sfx.h"
using namespace std;
using namespace sf;

sfx::sfx(){
        if (!Buffer.LoadFromFile("Resource/Sound/error.ogg"))
        {
                cout << "File not Found - Press enter to Continue..." << endl;
                cin.ignore(10000, '\n');
        }
        sfxERROR.GetBuffer(Buffer);

        if (!Buffer.LoadFromFile("Resource/Sound/hit.ogg.ogg"))
        {
                cout << "File not Found - Press enter to Continue..." << endl;
                cin.ignore(10000, '\n');
        }
        sfxHIT.GetBuffer(Buffer);


}

void sfx::sError()
{
        sfxERROR.Play();
}

void sfx::sHit()
{
        sxfHIT.Play();
}
 

int main(){

sfx SoundTest;

SountTest.sError();
SoundTest.sHit();

cin.ignore(10000, '\n');
}
 

Thanks in advance... I would also like ot be able to call this object global some how so I can call a soudn from anywhere in my progrema....

The idea is to have a class, and the constructor load into a variable all the sounds I need, and then have a simple way to play them from anywhere...

Am i completely about his wrong.. suggestions would help..

basically I have a game it is pretty simple and just want to add spots to play sounds..

22
Audio / Strange Music Behaviour (using demo code)
« on: April 14, 2012, 09:18:01 am »
Hi there,

I have been playing around and found a strange problem when i tried to use the Music.Play();  in a practical situation.. after much confusion I found a strange problem and it happens even in he  demo code in the tutorial section .. so I guess I am just not using it correctly?

I recorded the problem here do you can have a look
http://screencast.com/t/SLYFFtSfke

Basically this is the  exact code form the tutorial... I have jus tremoved somne of it.. but I am not sure why this would make a difference...

Here is my

MySounds.cpp - http://ideone.com/36yr1
MySounds.h - http://ideone.com/3HZOI

I call the class in main as "MySounds Sound;"

The plan is to add the audio to this class and use it to play things and stuff. I addedthe music to the constructor so it start as I declare the object I'll also add a few effect sounds that will always be live.

Anyway.. am i doing this all wrong? Why woudl i need a cin.get after the Music.Play() to make the sound come out?

23
Audio / Play 2 sounds?
« on: April 03, 2012, 11:59:35 am »
So i got SFML working...

How do I load a new sound in the buffer?

Code: [Select]
sf::SoundBuffer Buffer;
if (!Buffer.LoadFromFile("miss.ogg"))
return EXIT_FAILURE;

// Display sound informations
std::cout << "sound.wav :" << std::endl;
std::cout << " " << Buffer.GetDuration()      << " sec"           << std::endl;
std::cout << " " << Buffer.GetSampleRate()    << " samples / sec" << std::endl;
std::cout << " " << Buffer.GetChannelsCount() << " channels"      << std::endl;

// Create a sound instance and play it
sf::Sound Sound(Buffer);
Sound.Play();

system("Pause");

if (!Buffer.LoadFromFile("hit.ogg"))
return EXIT_FAILURE;

// Display sound informations
std::cout << "sound.wav :" << std::endl;
std::cout << " " << Buffer.GetDuration()      << " sec"           << std::endl;
std::cout << " " << Buffer.GetSampleRate()    << " samples / sec" << std::endl;
std::cout << " " << Buffer.GetChannelsCount() << " channels"      << std::endl;

// Create a sound instance and play it
sf::Sound Sound(Buffer);
Sound.Play();

// Wait until the user presses 'enter' key
std::cout << "Press enter to exit..." << std::endl;
std::cin.ignore(10000, '\n');

return EXIT_SUCCESS;

So how do i play other sounds.. do I make a new buffer each time? Or do I just load new sounds into the buffer and then play them with sound.play?

24
General discussions / VS2011 - Set it up per solution?
« on: April 02, 2012, 08:06:54 am »
Hi there...

In Vs2011 the options in the tutorial for setting it up is "depreciated" and it tells me to use the properties page on the individual projects. This is a real hassle as I need to "setup" sfml every time I start a new project inside the solution.

Is there a way in VS2011 (using a directory of my choice) to have SFML loaded for the entire solution? So every time I start a new project in teh solution it is already set up?

I am sorry if this is a stupid question but I am new to programming and only learning.

Thanks in advance
--aNewHobby

Pages: 1 [2]