stayscrisp's Profile
Reputation: 928
Master
- Group:
- Moderators
- Active Posts:
- 4,070 (2.12 per day)
- Joined:
- 14-February 08
- Profile Views:
- 67,356
- Last Active:
Today, 07:38 AM- Currently:
- Offline
Previous Fields
- Country:
- GB
- OS Preference:
- Who Cares
- Favorite Browser:
- Chrome
- Favorite Processor:
- Who Cares
- Favorite Gaming Platform:
- Nintendo
- Your Car:
- Hyundai
- Dream Kudos:
- 525
- Expert In:
- Game Programming, C++, Graphic Design
Latest Visitors
Posts I've Made
-
In Topic: SDL: Unable to move sprite
Posted 9 May 2013
Hi,
Wow! I don't even know where to start with your code.
This code below is the wrong order really, you want to fill the screen and then draw to it and then update it (you should look into double buffering also).
SDL_BlitSurface(sprite, &srcRect, screen, &player.spriteRect); //Blit the Krumm sprite SDL_UpdateRect(screen, 0, 0, 0, 0); //Update screen with new sprite SDL_FillRect(screen, NULL, 0x000000); //Fixes the ghosting issue
I don't want to copy and paste it but your animation handling is a little crazy. If you know the height and width of each frame then why can't you just increment by that each time you update?
But anyway that is not your current issue, your problem is that you are resetting the position of the sprite to 0 every time you call doPlayer() (which is every frame)
player.spriteRect.x = 0;
And yeah it does go on to update the position, but next time round will be exactly the same as you have reset the position again. -
In Topic: DirectX 11 Initialize
Posted 5 May 2013
-
In Topic: Proper implementation of States
Posted 2 May 2013
Check out my tutorials linked in my signature
-
In Topic: 2d platformer
Posted 18 Apr 2013
Spot the difference between this declaration:
virtual void Draw(sf::RenderWindow &Window);
And this definition:
void GameScreen::Draw() { } -
In Topic: SDL Runtime terminated in unusual way
Posted 17 Apr 2013
Do you have a stack trace? Do you know the location that the exception occurred?
My Information
- Member Title:
- フカユ
- Age:
- 28 years old
- Birthday:
- September 1, 1984
- Gender:
-
- Location:
- Hexham, UK
- Interests:
- Video Games, Coding Video Games, Playing Guitar, Newcastle United, Black Label Society
- Forum Leader:
- Game Programming, Graphic Design
- Years Programming:
- 5
- Programming Languages:
- C++, Flash Actionscript, HLSL
Contact Information
- E-mail:
- Click here to e-mail me
- MSN:
-
stayscrispinmilk
Friends
-

skyhawk133
-

Fib
-

kappuz
-

Elcric
-

Adkins
-

ghghgh
-

Chevon
-

kowwok
-

El3et
-

pradeepta46
-

Alex6788
-

macosxnerd101
-

Aivenn
-

ButchDean
-

VulcanDesign
-

m-e-g-a-z
-

Dean_Grobler
-

Tjohns
-

chinchang
-

badjava
-

ericr2427
-

aaron1178
-

Paronomasia
-

v0rtex
-

heyoman1
-

Kilorn
-

Twigz
-

trevster344
-

johnjohan1
-

RetardedGe...
-

Serapth
-

The Adrian
-

Frankma5
-

gaddam
-

nK0de
-

cynthia.bu...
-

Skydiver
-

shortycik
-

Red Prince
-

raghav.nag...
-

Gorian
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
aaron1178
03 Apr 2013 - 01:48raghav.naganathan
27 Dec 2012 - 20:46PabloSimo
28 Jan 2012 - 23:56civicdude95
19 Jan 2012 - 09:48trevster344
06 Jan 2012 - 10:44sidwwegame
01 Jan 2012 - 06:32aaron1178
26 Aug 2011 - 01:40aaron1178
10 Aug 2011 - 01:17gabehabe
27 Jul 2011 - 10:25Achri
20 Jul 2011 - 18:53I'd like to request an SDL_net tutorial to add on to your tutorials. The way you write makes it easy to learn. Thanks
gabehabe
12 Jul 2011 - 03:08ButchDean
07 Jul 2011 - 05:33stayscrisp
07 Jul 2011 - 02:13Dogstopper
06 Jul 2011 - 14:54(Avatar movie reference)
RandomlyKnighted
06 Jul 2011 - 13:12