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 / Collision problem with stoping the sprite.

Author
Message
Fency Federejshn
16
Years of Service
User Offline
Joined: 8th Dec 2007
Location:
Posted: 13th Dec 2007 21:52
The thing is that i created my own collision function (dbSpriteCollision wasn't good for me and my special needs )

this is what it looks like




and when ever it's hit i do this




whenever any key is presed it moves for 2 pixles...

THE THING IS.. that i dont know how to efficiently stop my sprite!!! help

fency federejshn
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 14th Dec 2007 21:10
Shut down your PC! Its guaranteed to stop!

Seriously - what do you mean - you want it to slow down or something? What are left up down etc? Did you mean to say dbLeftKey() or whatever the call is for the arrow keys?

There isn't enough info here - I don't think.

Are those left, right, etc supposed to be variables related to what side got "hit" or something? If so - we are missing code to really nail your issue. At least for my quick scan of it - sometimes someone comes in after me and saves the day - so hopefully someone else get's what you mean - or post some source code - like SOME MORE source code. We aren't going to a make a million stealing a snippet - so don't be shy - I personally want to see your declarations to see how this is suppose to work - you might have a general program flow issue or something - logic falling through funny cuz of a double variable declaration - or accidently using a variable name that is "something else" somewhere else in your global namespace - (Basically - I mean its rare but has happened to me - where I use a variable name - and pull my hair out just to find eventually that that variable is part of someother C++ code or something - and it didn't bomb because I used it correct - but I picked a different variable and WHELLA)

Fency Federejshn
16
Years of Service
User Offline
Joined: 8th Dec 2007
Location:
Posted: 15th Dec 2007 13:03
Your right Jason, i posted a very small amount of code... here is the holle code and the exe so that you can see what's happening.




I comented the code so that you can easaly understand.

sorry for the spelling.

fency federejshn

Attachments

Login to view attachments
dbGamerX
16
Years of Service
User Offline
Joined: 23rd Nov 2007
Location:
Posted: 15th Dec 2007 13:32
Correct me if I'm wrong, but where have you specified the bounderies? Plus all those integers your initializing... What are their values?

If the compiler gives LeftA = 10, then 10 + 40 = 50. If it gives it -4, -4 + 40 = 36.

Hmm, so int x and y are the coordinates? Isn't the origin of your map supposed to be (0,0)? Just tell me what your variables are supposed to do and I'll help you. Cause I'm confused lol

dbPrint ( "Sig" );
Fency Federejshn
16
Years of Service
User Offline
Joined: 8th Dec 2007
Location:
Posted: 15th Dec 2007 13:57
Well, the sprite is not sopoused to go out off the window, i dint yet code that, but i will,

I dont understand what you dont understand

x,y are the coordinates of my sprite, simple.

P.S: have you looked at the exe, i think that will give you a very good idea of whats going on.

fency federejshn
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 15th Dec 2007 14:56
Here - this is working now - and I cleaned a few thigns here and there - hope you don't mind.


dbGamerX
16
Years of Service
User Offline
Joined: 23rd Nov 2007
Location:
Posted: 15th Dec 2007 15:11
HA! You're right, Fency, I don't understand what you don't lol. Nice, Jason, you fixed it Good job.

dbPrint ( "Sig" );
Fency Federejshn
16
Years of Service
User Offline
Joined: 8th Dec 2007
Location:
Posted: 15th Dec 2007 17:42 Edited at: 15th Dec 2007 18:38
EDIT: HOLLY SH*** IT WORKS THANKS A BILLION JASON!!!!!

fency federejshn
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 15th Dec 2007 18:34
Not anymore Notice lack of moving flag? Was causing 1 loop with no movement - hence a slight "staggered" look as you crossed tile bounds.

Hows this work for ya?



Fency Federejshn
16
Years of Service
User Offline
Joined: 8th Dec 2007
Location:
Posted: 15th Dec 2007 18:41
I don't believe it!!! COOL!!! thanks again Jason, you really should be crowned moderator!!!

fency federejshn

Login to post a reply

Server time is: 2024-10-08 18:24:21
Your offset time is: 2024-10-08 18:24:21