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.

Newcomers DBPro Corner / Sprite Character Movement errors. Sidescroller

Author
Message
My games are free
15
Years of Service
User Offline
Joined: 28th Sep 2009
Location: Under your Bed
Posted: 1st Mar 2012 01:48 Edited at: 1st Mar 2012 01:49
I decided to (yet again) use Dark Basic Pro, i'm still a little in C++ and there could be accidental C++/Allegro in my code that might be the problem as i have gone totally upside down with these, but into the problem. I have set a FUNCTION that determines what happens when i press something.


that code above is from my Function part
i dunno what is wrong here but heres my code for the main loop


Thought of posting this before i gosub sleep

sleep:
print "because it is 2:47 A.M here"

Good night ya'll and thanks

EDIT: oh and almost forgot, i use sprite sheets and .bmp
thanks again
My games are free
15
Years of Service
User Offline
Joined: 28th Sep 2009
Location: Under your Bed
Posted: 1st Mar 2012 01:53
And how should i make a 2D platformer/sidescroller Camera.

Thanks again
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 1st Mar 2012 08:26
Quote: "i dunno what is wrong here but heres my code for the main loop"

The problem is that as soon as you enter either the GoLeft() or GoRight() function, you enter another infinite loop. As the main loop will already loop through the functions try taking out the 'do sync loop' in each of them.

Quote: "And how should i make a 2D platformer/sidescroller Camera."

If you're using 2D planes in a 3D world then you can simply make use of the camera commands, if you're using just 2D sprites then you'll have to program the movement/camera yourself.

My games are free
15
Years of Service
User Offline
Joined: 28th Sep 2009
Location: Under your Bed
Posted: 1st Mar 2012 12:57
Took the Do... Loop stuff out, it doesnt move now. and i forgot to ask, i cant see the 4th sprite when going left, help anyone?
My games are free
15
Years of Service
User Offline
Joined: 28th Sep 2009
Location: Under your Bed
Posted: 1st Mar 2012 18:02 Edited at: 1st Mar 2012 21:37
*Fixed It. I just forgot to make the xPos and yPos global




Still having problems with the 2D sidescroll camera, i wouldn't mind changing it like background would move but im kinda lazy today

thanks all

Login to post a reply

Server time is: 2024-11-22 06:15:12
Your offset time is: 2024-11-22 06:15:12