Computer Science Canada bouncing picture ? |
Author: | gilbamy [ Fri May 05, 2006 12:28 pm ] | ||
Post subject: | bouncing picture ? | ||
Alright i need to make a picture that bounces around the screen and the picture does not get cut off okay my problem is that it shows the picture and the errow at my second Pic.Draw and my teacher wants us to use Draw.Pic and i have to use the psuedo code that he gave us and he won't explain why mine does not work and i tried searching for what Draw.Pic was and it said that it was drawpic .
|
Author: | do_pete [ Fri May 05, 2006 12:40 pm ] |
Post subject: | |
You'll need to use Pic.Width and Pic.Height |
Author: | gilbamy [ Fri May 05, 2006 12:44 pm ] |
Post subject: | |
pic1h and pic1w equal the Pic.Width stuff and the Pic.Height |
Author: | do_pete [ Fri May 05, 2006 12:52 pm ] | ||
Post subject: | |||
Okay, then you'll have to detect when the picture is touching the edge of the screen by going
|
Author: | gilbamy [ Sat May 06, 2006 9:04 pm ] |
Post subject: | |
but the problem is that my program won't run with that Draw.PIc thing and i nedd it their |
Author: | codemage [ Mon May 08, 2006 8:10 am ] |
Post subject: | |
Try Pic.Draw |
Author: | gilbamy [ Mon May 08, 2006 1:19 pm ] |
Post subject: | |
so its Pic.Draw(pic1,x,y,mode) but what is mode and what does it do |
Author: | gilbamy [ Mon May 08, 2006 1:34 pm ] | ||
Post subject: | |||
okay i got that pic.draw thing to work but now my picture won't bounce around the screen so here is my code updated
|
Author: | Albrecd [ Mon May 08, 2006 1:42 pm ] | ||
Post subject: | |||
Your picture does not move because you draw your picture at point (x, y), which does not change, then you change pic1x and pic1y which, at the moment, do nothing. Also:
|
Author: | gilbamy [ Mon May 08, 2006 1:52 pm ] |
Post subject: | |
the code you gave me is the same as mine and i have no idea how that would effect it anyway ![]() |
Author: | Albrecd [ Mon May 08, 2006 1:59 pm ] |
Post subject: | |
I know it's your code. That's the point. It has errors. I am pointing them out. |
Author: | gilbamy [ Tue May 09, 2006 11:19 am ] |
Post subject: | |
how do i know what the problem is if know one tells me |
Author: | gilbamy [ Tue May 09, 2006 12:48 pm ] | ||
Post subject: | |||
alright i changed some things around that i did not see at the time and it still does not bounce around the screen so here is my code updated again ![]()
|
Author: | Clayton [ Tue May 09, 2006 12:58 pm ] |
Post subject: | |
the problem is you are drawing the picture at (your variable names) (x,y) not (pic1x,pick1y), so when you update pic1x and pic1y you arent doing anything, eliminate x and y or pic1x and pic1y and use the other to move your pic (this was stated above as well) |
Author: | gilbamy [ Wed May 10, 2006 10:55 am ] |
Post subject: | |
sweet that worked thx but now it says that thir is something wrong with Draw.Pic(backg,pic1x,pic1y,PicCopy)its like an illegal pic id number'0' |
Author: | gilbamy [ Wed May 10, 2006 11:20 am ] | ||
Post subject: | |||
alright here is my new code with that stupid line
|
Author: | do_pete [ Wed May 10, 2006 11:21 am ] |
Post subject: | |
That means that the picture was not succesfully created. Check to see if it is in the same folder as your code or that you specify the folder. Also check that you have hte picture name right when you create it using Pic.FileNew. |
Author: | gilbamy [ Wed May 10, 2006 1:40 pm ] | ||
Post subject: | |||
the picture appears and moves but then it stops and then comes up with the illgeal picture id
thats that stupid line code that won't work |
Author: | do_pete [ Wed May 10, 2006 2:42 pm ] |
Post subject: | |
Sorry about my previous comment; I didn't see you were using Pic.New so disregard what I said about folders and Pic.FileNew. Anyways, you shouldn't use Pic.New that way because it takes up a lot of memory and the reason you get an error is because it can't create the picture fast enough. |
Author: | gilbamy [ Thu May 11, 2006 11:52 am ] |
Post subject: | |
so how do i get the error to go away though thats the problem because i don't know if changing it to Pic.New will help |
Author: | gilbamy [ Thu May 11, 2006 11:59 am ] |
Post subject: | |
hehe i truly hate turing right now i will take a my copy and smash it with a hammer that might though cost more money in which i lack so i will copy this stupid program and smash it into tiny little pieces . ![]() |