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.

Dark GDK / Rotating Sprite Problem

Author
Message
Kira
16
Years of Service
User Offline
Joined: 25th Jan 2008
Location:
Posted: 25th Feb 2008 09:17
hi there, ive been searching the forum on how i could properly rotate a sprite. ive seen a method like this one
but my sprite doesnt rotate. am i doing it right?
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 25th Feb 2008 14:43
I haven't done it - SOMETIMES in this GameDev Gig - there are angles where they are based on -1 thru +1 (via floats) versus 0-360.

Usually 0 thru +1 represents 90degrees though. I doubt it applies but I haven't tried to rotate a sprite...yet.

kBessa
18
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 25th Feb 2008 14:55
Shouldn't it be dbRotateSprite(1,dbSpriteAngle(1)+angle); ?
Kira
16
Years of Service
User Offline
Joined: 25th Jan 2008
Location:
Posted: 25th Feb 2008 19:37
@jason

ive tried the +1 and -1 and it seems that they function relatively to 0-360

@kBessa

yep, changed the syntax and still no joy. the darn needle doesnt even budge
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 25th Feb 2008 19:39
hmm... I'll try to remember to take a stab tonight when I fire up the VS Studio.

Kira
16
Years of Service
User Offline
Joined: 25th Jan 2008
Location:
Posted: 26th Feb 2008 16:22
so~ any progress? here's also another problem, whenever i try to rotate the sprite hard-coded, it doesnt seem to be rotating but it throws the sprite in the screen.

sprite doesnt also move whenever i press the respective key as well. any dev-mods or people out there that could help me?
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 26th Feb 2008 16:47
Idea. This is how I COULD give you a Direct answer.

Post your code - or a small demo program that just loads a sprite - and accepts keypresses that rotate left and right.

I PROMISE to download, test, and try to fix it or get it working for you if you do that.

Don't forget - you can email too - but I think this issue would be better served HERE so other can benefit.

Kira
16
Years of Service
User Offline
Joined: 25th Jan 2008
Location:
Posted: 26th Feb 2008 17:07
sure sure! actually, ive made the sprite move by moving it here
where the meter() code is


dbKeyState(16) is used in my movePlayer(). here's the new problem, the sprite does rotate but not by itself, it looks like it's revolving in a point and i know because the sprite eventually comes back to my screen... now if only i could use fraps and post it here.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 27th Feb 2008 05:13


Media Two files - will be two post so easy get for ya...first - my cheap gauge....

Attachments

Login to view attachments
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 27th Feb 2008 05:19
Media Attahced: The Needle.


Note that I saw your Issue. I thought there was a command to change the "CENTER pivot point of the sprite... maybe there is and its just not in DarkGDK Help...hmmm...one sec....Nope...Not in DBPro either.

If it was me I'd try to use object plains (locked to screen or something) because I'd want a nicer needle than what I just gave ya... but I kept my promise. I managed to get a 2 sprite gauge working.

I hope this helps you out and either is useful OR - makes you rethink the whole thing.

Plains are nice because the "spin center" is in the middle!

Best Regards,
Jason

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-20 03:27:57
Your offset time is: 2024-11-20 03:27:57