Platform game sidescrolling
Hey I am new with java and was following a video tutorial to learn it, but something that works with the tutor doesn't work for me and I don't know what is wrong.
It needs to do sidescrolling when A or D is pressed (A=left D=right) but it doesn't! In fact, my character won't even more anymore.
And I don't know how to show you the codes because i can't add URLs :(
Thanks in advance!
Re: Platform game sidescrolling
Just CnP the code here. All you need to do would be something like this:
-Every time your game loop does a loop, check if A or B is pressed; if the A key is pressed then do X-- else if the B key is pressed then do X++.
-Now just render the screen with the new X location at the center.
I can\'t really say much more than that without your code.
Re: Platform game sidescrolling
Re: Platform game sidescrolling
Copy and paste the code here, preferably as an SSCCE
Re: Platform game sidescrolling
Wait what? SSCCE?
There are multiple files so which one should i post?
Re: Platform game sidescrolling
Quote:
Originally Posted by
teunissenstefan
Wait what? SSCCE?
There are multiple files so which one should i post?
See the link in my signature
Re: Platform game sidescrolling
Uh, but how is it possible to Copy and paste as SSCCE?
Re: Platform game sidescrolling
Quote:
Originally Posted by
teunissenstefan
Uh, but how is it possible to Copy and paste as SSCCE?
1) Create an SSCCE 2) Copy the code 3) paste the code into the text box when posting to the forums - wrap all code using the [highlight=java][/highlight] tags
Re: Platform game sidescrolling
create a SSCCE? how da hell should i do that?
I thought it was a method to do something :S
--- Update ---
Oh nevermind, the code was actually right i always forget to save some xD
Thanks all that wanted to help