Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


proanim

Member Since 16 Mar 2011
Offline Last Active Feb 06 2015 09:03 PM

Posts I've Made

In Topic: floating sprite problem

06 February 2015 - 06:26 PM

Do I must have two separate instances for this to work? Can I still make this work if I don't separate logic and rendering? I know it might not be recommended practice but, I don't want to make stuff overly complex.


In Topic: floating sprite problem

05 February 2015 - 03:57 PM

I tried to do that by following this implementation, here: https://www.youtube.com/watch?v=6eSjPz5k278 and it didn't help at all, whats worse it degraded the performance to the point of unusable.

 

This is what I used to get my delta time in my original post:

#ifndef _TIMER_H_
#define _TIMER_H_

#include <ctime>

// adapted from timer class found on internet (no real changes, just coding style)
class TimerClass
{
public:
	void start(); // constructor
	void stop(); // de-constructor
	void getTimes();

	// begin/end variables
	clock_t begin, end;
	// variable declarations used for time calculation
	double ticks, msec, sec, min;
};

#endif

////////////////////////////////////

#include "timer.h"

void TimerClass::start()
{
	begin = clock() * CLK_TCK;
}

void TimerClass::stop()
{
	end = clock() * CLK_TCK; getTimes();
}

void TimerClass::getTimes()
{
	ticks = end - begin;	// stop the timer, and calculate the time taken
	msec = ticks / 1000;	//milliseconds from Begin to End
	sec = msec / 1000;		//seconds from Begin to End
	min = sec / 60;			//minutes from Begin to End
}

I reached the point of total confusion, and I don't know how to implement loop suggested above with my own. sad.png


In Topic: floating sprite problem

05 February 2015 - 12:51 PM

 

 

Are you mixing SFML with Win32 for what purpose?

i need a level editor with multiple windows menu bar and stuff, along side of sfml rendering window


In Topic: Crash with <unable to read memory> error

01 December 2014 - 09:26 AM

Ok i fixed it, thank you. Turns out I can't access with -> instead I need to use (dot). 

 

my code had the following:

GameMap* Map;
Map->CreateMap(5, 5);

... and a like.

 

now it MUST be

GameMap Map;
Map.CreateMap(5, 5);

Why is this?


In Topic: How to get correct coords of the sprite

31 October 2014 - 09:21 AM

It may be difficult to explain so take a look at these two screenshots

 

This one is when mouse is outside of the region that is a square 96x96 and is positioned to render windows 0,0 (but I positioned camera differently and zoomed out, as i have shown in the code)

 

grid1.jpg

 

And this one is when the mouse is in the region, original one (that is the square region from 0,0 to 96,96), that is placed just under the 'file' menu, not the actual, top left grid tile.

 

grid2.jpg

 

What I wanted is to have marker tile like in second screenshot when I hover over the tile, regardless of camera settings. So, from there, I guess my problem is getting info on where the actual sprite is and its current size.


PARTNERS