Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / sprites shake when backgrounds scroll

Author
Message
gsdblack
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 13th Mar 2012 09:05
When I scroll the background the sprites that don't move shake but the moving sprites look fine. Has anyone run into this problem?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Mar 2012 11:08
Not sure what you mean. Could you post some example code?

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 13th Mar 2012 12:39
i have a large scrolling background sprite & small stationary sprites. they don't shake at all, they stay 100% in their place!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Mar 2012 12:45
Yes, me too. I think it might be that you are using an integer value for positioning the sprites rather than a float?

Hard to say without seeing some code... or a crystal ball

gsdblack
12
Years of Service
User Offline
Joined: 6th Dec 2011
Location:
Posted: 13th Mar 2012 19:13
Here's an example of me loading an image and creating a sprite




Heres code for how I scroll the background.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Mar 2012 22:38
I'm afraid I can't test your code as I'm a Tier 1 user but it looks OK at a glance other than I don't see you explicitly defining "movePlayerx" as a float, do you not need to use the "float" declaration as you would need to in C#? I see you are using the "f" after the number but I am not aware whether that is enough in C++?

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 13th Mar 2012 23:26
Baxslash, the problem is definitely not with movePlayerx. It's defined somewhere else in his code, else it won't even compile
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Mar 2012 00:28
I guess it could be that you are only using movePlayerx when x=0. So you are jumping between a value of 0.0 and 0.35?

Login to post a reply

Server time is: 2024-05-07 18:46:12
Your offset time is: 2024-05-07 18:46:12