Computer Science Canada Slowing Movement with custom-made Joystick |
Author: | xHoly-Divinity [ Tue Feb 22, 2005 3:54 pm ] | ||
Post subject: | Slowing Movement with custom-made Joystick | ||
When then joystick moves, the block moves with it, as you can see. However, the movement of the block is too fast. How can i slow it down without adding a delay. (What i tried to do was divide the bottom line by 2, but then it wouldn't be an integer value so it shows an error).
|
Author: | Flikerator [ Tue Feb 22, 2005 4:01 pm ] | ||
Post subject: | |||
Make a lot of calculation commands or something in a process and fork it a bunch of times.
Something to that degree. |
Author: | cool dude [ Tue Feb 22, 2005 4:05 pm ] |
Post subject: | |
i would just put a delay in it because forks are bad and i suggest not to use them. |
Author: | Flikerator [ Tue Feb 22, 2005 4:07 pm ] |
Post subject: | |
cool dude wrote: i would just put a delay in it because forks are bad and i suggest not to use them.
You are trying to slow down the program without Delay..The only reason not to use a fork is because it slows down your program, are ugly, and go at different times. All of those dont really matter for what he is doing.. |
Author: | xHoly-Divinity [ Tue Feb 22, 2005 4:07 pm ] |
Post subject: | |
If i add a delay, then it becomes really laggy, and the movement isn't smooth. Also, it is VERY bad to add a lot of delay when using mousewhere because the drawing of the circle will be delayed. ![]() |
Author: | Flikerator [ Tue Feb 22, 2005 4:31 pm ] |
Post subject: | |
Well if you make a process and then fork it it will slow down your program. The more things in the process the slower it will be. Given its not the best method it works best with a loop. I prefer to use delay but if you dont want to just have a lot of forks. |
Author: | xHoly-Divinity [ Tue Feb 22, 2005 4:34 pm ] |
Post subject: | |
Alright, thanks. I was just wondering if it was possible to set something at decimal coordinates e.g. drawbox (50.5, 30.5, 100, 100, black). If it's possible then plz do tell |
Author: | Flikerator [ Tue Feb 22, 2005 4:41 pm ] |
Post subject: | |
xHoly-Divinity wrote: Alright, thanks. I was just wondering if it was possible to set something at decimal coordinates e.g. drawbox (50.5, 30.5, 100, 100, black). If it's possible then plz do tell
Nope its not possible. You can't have somethign on Half a pixel ![]() |
Author: | xHoly-Divinity [ Tue Feb 22, 2005 5:56 pm ] |
Post subject: | |
I made a new version of the program using fork, however, utilizing fork in the way that it is is no different from using delay. GRRRRR ![]() |
Author: | Flikerator [ Tue Feb 22, 2005 7:01 pm ] |
Post subject: | |
Use a cooldown. That would probably work, talk to "Cervantes" on how to do cooldown, im not entirely sure how to do such a thing yet. Hopefully he won't hate meh for telling people to ask him for help and askign for help myself lolz. |
Author: | Bacchus [ Tue Feb 22, 2005 11:00 pm ] | ||
Post subject: | |||
change this part:
|
Author: | xHoly-Divinity [ Wed Feb 23, 2005 5:09 pm ] |
Post subject: | |
Wow!! Thanks man, that's good stuff. Well just to show you what the final code of the joystick movement is. I was wondering if you guys can give me an idea of how to apply it to some sort of game, because that would be awesome. I was thinking of some sort of "moving background game". P.S. Yes, I've already looked at the game ideas section, but most of them don't really apply to this and I want something original. It would be of great help, if you could offer your suggestions ![]() |
Author: | Flikerator [ Wed Feb 23, 2005 5:41 pm ] |
Post subject: | |
Mabey try a ship game of some sort? I never use a joystick so I can't really help you there ![]() |
Author: | mike200015 [ Wed Feb 23, 2005 5:55 pm ] |
Post subject: | |
Another idea.. you could do a target practice type game, and you move around with the joystick and shoot the targets by pressing the buttons? ![]() |
Author: | xHoly-Divinity [ Wed Feb 23, 2005 6:19 pm ] |
Post subject: | |
I will do both, trust me. I'll give you the end result when i'm done ![]() |
Author: | mike200015 [ Wed Feb 23, 2005 6:26 pm ] |
Post subject: | |
![]() |
Author: | xHoly-Divinity [ Wed Feb 23, 2005 6:43 pm ] |
Post subject: | |
I was wondering (I am starting with a boat shooting game) a few things. For the bg could I make it move up vertically just the same way it moves horizontally. Also, I'm wondering if it is possible to have multiple inputs at a time e.g. to be holding and moving the joystick and at the same time be pressing space to fire a missile? |
Author: | mike200015 [ Wed Feb 23, 2005 9:02 pm ] |
Post subject: | |
xHoly-Divinity wrote: For the bg could I make it move up vertically just the same way it moves horizontally.
What do you mean by makin the bg move up vertically / horizontally ![]() |
Author: | xHoly-Divinity [ Thu Feb 24, 2005 3:53 pm ] |
Post subject: | |
What i meen by moving the background, is that the bg scrolls up as you move up. E.g. like in super mario as you move to the left, the background/screen moves left with him |
Author: | mike200015 [ Thu Feb 24, 2005 5:09 pm ] |
Post subject: | |
ooo.. kk.. got it, but it doesnt technically have to be the bg moving, jus the objects that are in the bg, (ie.shapes in the bg, just make them move..) |
Author: | xHoly-Divinity [ Thu Feb 24, 2005 5:16 pm ] |
Post subject: | |
Alright, but would you mind elaborating on that a bit please ![]() |
Author: | mike200015 [ Thu Feb 24, 2005 5:24 pm ] |
Post subject: | |
kk.. so say in a game like mario, with the blocks etc. in the background, so if you make sumthing like that, when the character gets to say maxx, and if they press the right arrow key again, then the blocks in the bg will move 1 space to the left, to seem as though you are moving right. Sorry if i didnt explain it well, might sound a lil confusin ![]() |
Author: | xHoly-Divinity [ Thu Feb 24, 2005 5:27 pm ] |
Post subject: | |
Yeah, there's a tutorial on it. I was just asking if it would act the same way if you wanted it to go up and down as opposed to left a right? |
Author: | mike200015 [ Thu Feb 24, 2005 5:39 pm ] |
Post subject: | |
oo, sorry. Yea i would assume so, bcuz if u would move up, you just move the shape down, and vice versa for if you move down. |
Author: | xHoly-Divinity [ Thu Feb 24, 2005 6:23 pm ] |
Post subject: | |
Mind giving me a link to the tutorial. I remember seeing it but I can't remember where it was ![]() |
Author: | mike200015 [ Thu Feb 24, 2005 6:28 pm ] |
Post subject: | |
Sorry, havent seen the tutorial bout it. Do you know what the topic of it was, so i can search for it, n if i find it ill let you know. |
Author: | xHoly-Divinity [ Thu Feb 24, 2005 6:32 pm ] |
Post subject: | |
I'm not 100% sure but I could have sworn it was something along the lines of "moving background", I think there was one recently called "Making background bigger than screen size" or sumfin like that. Thanks man, that would be a big help ![]() |
Author: | mike200015 [ Thu Feb 24, 2005 6:38 pm ] |
Post subject: | |
kk.. ill look for it, if i find it ill let you know |
Author: | xHoly-Divinity [ Thu Feb 24, 2005 6:41 pm ] |
Post subject: | |
THANKS!!! ![]() |
Author: | xHoly-Divinity [ Sat Feb 26, 2005 1:10 pm ] |
Post subject: | |
Hey, you don't have to worry about it anymore, I found the tutorial I was looking for. I will post a copy of the game when im done so keep updated 8) |
Author: | mike200015 [ Sat Feb 26, 2005 3:51 pm ] |
Post subject: | |
xHoly-Divinity wrote: Hey, you don't have to worry about it anymore, I found the tutorial I was looking for. I will post a copy of the game when im done so keep updated 8)
o.. kk.. yea i was lookin i couldnt find it under the names u gave me .. can u post the tutorial ![]() |
Author: | xHoly-Divinity [ Sat Feb 26, 2005 4:05 pm ] |
Post subject: | |
As soon as I'm done my game, I will MAKE a tutorial on it ![]() |
Author: | mike200015 [ Sat Feb 26, 2005 7:22 pm ] |
Post subject: | |
lol.. kk.. nice ![]() |
Author: | mike200015 [ Sat Feb 26, 2005 7:23 pm ] |
Post subject: | |
lol... kk.. nice ![]() ![]() EDIT Woops sorry, didnt mean to post that twice ![]() |