Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Luigi (mario with green instead of red)
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Cervantes




PostPosted: Sat Jun 04, 2005 7:53 pm   Post subject: (No subject)

MysticVegeta wrote:
or bmp,
btw whats your post supposed to mean, Cervantes? what is computerOperator.move?

Looks like a array and a record, was it a prank lol?


Mm, computerOperator is an imaginary instance of an imaginary class that refers to the operator of the computer. This imaginary class has a method, move, that takes two parameters, both being strings. The first represents the appendage or body part of the operator that will be moved, and the second refers to the location.
So, essentially, I was telling him to run the program and then hit the "Print Screen" button on the keyboard. From there, things are self-evident.

gohan wrote:

I can tell u tht it has to do with for loops....

Noo! It has to do with variables storing the x and y positions of the picture, not for loops! If you want to simply move the picture across the screen (and do nothing else at the same time), sure, use a for loop. But if the picture needs to move at the same time as something else is happening, you must use variables. There is no other option. Wink Also, using variables allows you to move the picture based on input, but a for loop doesn't lend itself to this quite so well...

Cheers
Sponsor
Sponsor
Sponsor
sponsor
Ketseuki




PostPosted: Tue Dec 13, 2005 2:49 pm   Post subject: (No subject)

sorry to bug you guys on this topic again but I'm using the code
code:
var mypic :int := Pic.FileNew ("C:\\back_sword.bmp"

and I cant get the picture into Turing still. I would apreciate the help
thank you
Ketseuki




PostPosted: Tue Dec 13, 2005 2:51 pm   Post subject: (No subject)

Ketseuki wrote:
sorry to bug you guys on this topic again but I'm using the code
code:
var mypic :int := Pic.FileNew ("C:\\back_sword.bmp"

and I cant get the picture into Turing still. I would apreciate the help
thank you


sorry, there is another braket so the code is

code:
var mypic :int := Pic.FileNew ("C:\\back_sword.bmp")
Cervantes




PostPosted: Tue Dec 13, 2005 4:59 pm   Post subject: (No subject)

Does it give you an error? Or are you just not drawing it...

If it does give you an error:
Are you sure the file path is correct? Does that file exist? Is it a .bmp? (I suggest turning off that option that hides extensions of known file types. What a ridiculous idea: you end up creating files like test.txt.txt. In Windows Explorer -> Tools -> Folder Options -> Uncheck Hide Extensions of known file types.) It might not make any difference, but try using a lowercase "c".
RedRogueXIII




PostPosted: Tue Dec 13, 2005 5:42 pm   Post subject: (No subject)

depends on how your moving it, anyways yea you have to use loops drawing and refreashing the image at the time.

quickexample
code:

% Set screen to graphics, and set for animation
View.Set("graphics:max,max, offscreenonly")
var mypic :int := Pic.FileNew ("C:\\luigi.bmp") %or put the jpg for your case
var x,y:int:=100 % x and y where the pic will be drawn
var mx,my,mb:int % variables that will hold the mouse location
%Keyboard Input
var chars : array char of boolean

% The Loop
loop
% FOr Keyboard movement!
Input.KeyDown (chars)
    if chars (KEY_UP_ARROW) then
         += 5
    end if
    if chars (KEY_DOWN_ARROW) then
       y -= 5
    end if
    if chars (KEY_RIGHT_ARROW) then
        x += 5
    end if
    if chars (KEY_LEFT_ARROW) then
        x -= 5
    end if

% For Mouse movement
mousewhere(mx,my,mb) % declare where the mouse is
if mb = 1 then % click then sets the picture to where you clicked at.
x:=mx
y:=my
end if


delay (10)
cls
View.Update % Update/ REFRESH The  screen

Pic.Draw (mypic, x, y, 0)
end loop



there is an example of moving a picture from file.
Ketseuki




PostPosted: Wed Dec 14, 2005 1:49 pm   Post subject: (No subject)

No, its not giving me an error, it just isn't drawing the pic. says "finished execution"

I tried the lower case "c", thanks, but it didnt work, it IS the right spelling, the file DOES exist, and it IS on the "C:" drive

thanks for the help, even if you can't figure it out. I am greatly appretiative of your time.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 21 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: