
-----------------------------------
TokenHerbz
Wed Sep 21, 2005 12:12 am

Flashing / cls / View.Update
-----------------------------------
Hey, i got mass flashing happening with just words...

THis isn't the code, but heres the example


loop
    cls
    put "Health: ", player.Health
    if Somthing then
         player.health += 5
    end if
    View.Update
end loop


So somthing along the lines of that, Though i tryed many combinations of just CLS, just View.Update, Using both, In different spts aswell, And even trying to stop it with delays...

I can slow it with a delay, though then i cant do input, as the program stops, So, you can see im in a bit of a pickle, am i useing these wrong? 

Please help, Thnaks

-----------------------------------
beard0
Wed Sep 21, 2005 6:55 am


-----------------------------------
Have you used View.Set("offscreenonly")?  It is necessary to do this before View.Update becomes effective.

-----------------------------------
Flikerator
Wed Sep 21, 2005 8:23 am


-----------------------------------
Beard0 is right. View.Update is useless without View.Set("offscreenonly")

You will just be updating it another time. Each time a line of code is run in turing it updates the screen. If you have offscreenonly on it will only update the screen when you tell it to using View.Update() or View.UpdateArea().

-----------------------------------
TokenHerbz
Wed Sep 21, 2005 7:58 pm


-----------------------------------
Where do i add offscreenonly, and do i need the () After View.Update...

ALSO, Using getch, do i need Input.KeyDown??? To use the ARROW keys, etc?

-----------------------------------
Cervantes
Wed Sep 21, 2005 8:29 pm


-----------------------------------

Where do i add offscreenonly, and do i need the () After View.Update...

ALSO, Using getch, do i need Input.KeyDown??? To use the ARROW keys, etc?

At the beginning, no, no, respectively.

To clarify the last question, it's best not to use getch and Input.KeyDown together.  I was just discussing this in the 
var c : string (1)
loop
    getch (c)
    put c = KEY_RIGHT_ARROW
end loop


-----------------------------------
TokenHerbz
Thu Sep 22, 2005 3:15 am


-----------------------------------
so how do i use it ?


var c : string (1)
loop
    getch (c)
    if c = KEY_RIGHT_ARROW then
         x += 1
    end if
end loop 


Like so?  does this work with Esc / A, the letters / numbers / Enter? Eveything on the keyboard?

-----------------------------------
jamonathin
Thu Sep 22, 2005 9:05 am


-----------------------------------

Like so?  does this work with Esc / A, the letters / numbers / Enter? Eveything on the keyboard?
 That's like asking, "can i use variables to represent the x and y values of a circle?"  Drrrrr...... Well why dont you try. The best way to learn is through trial and error. 

Ever been told not to touch a hot stove, then touched it?  Learn through experience.

-----------------------------------
Cervantes
Thu Sep 22, 2005 3:20 pm


-----------------------------------

Ever been told not to touch a hot stove, then touched it?  Learn through experience.
For something like this, yes.  For many other things, learn from other's experiences.

-----------------------------------
TokenHerbz
Thu Sep 22, 2005 8:42 pm


-----------------------------------
Stupid getch,  my program keeps saying, Waiting for input...

How do i use this correctly, i been trying to a while...

Im going to read more up on this, and hasch

mean while please help me a bit, these are very confusing...




Edit:::::


setscreen("Graphics:300;300")
View.Set("offscreenonly")

var x, y: int := 150
var c: string(1)
var s: int := 1
var co: int := 7

loop
    cls
    getch (c)
    
    if c = KEY_RIGHT_ARROW then
        x += 1
    end if
    if c = KEY_LEFT_ARROW then
        x -= 1
    end if
    if c = KEY_UP_ARROW then
        y += 1
    end if
    if c = KEY_DOWN_ARROW then
        y -= 1
    end if
    if c = KEY_ENTER then
        s += 1
    end if
    if c = KEY_SHIFT then
        randint(co,1,100)
    end if
    if c = KEY_ESC then
        exit
    end if
    drawfilloval(x,y,s,s,co)
    View.Update
end loop
cls
put "you quit"


try that, i have a problem...

A) Top left, theres a black box which i do not want there, it seems to was input all the time
B) it seems slow...
C) It cant *Multi command*   (though i wont need that with my RPG*)

-----------------------------------
Cervantes
Fri Sep 23, 2005 9:59 am


-----------------------------------
For this sort of thing, use Input.KeyDown.

-----------------------------------
TokenHerbz
Fri Sep 23, 2005 4:25 pm


-----------------------------------
alright, Then

Why is getch useful if i can just USE KeyDown?

What are the strengths of getch over keydown?

-----------------------------------
Cervantes
Fri Sep 23, 2005 6:37 pm


-----------------------------------
Getch is better for typing, or other things where only one key is pressed at a time and keys are generally not held for long.
Input.KeyDown is good for more complex input where multiple buttons may be held at the same time, and where a constant stream of boolean values on any specific key is required.  (For example, we don't want to check if the right arrow is hit, we want to check if it is down.)

-----------------------------------
TokenHerbz
Sat Sep 24, 2005 4:44 pm


-----------------------------------
Alright, and it is bad to mix them?

Why is this?

-----------------------------------
Cervantes
Sat Sep 24, 2005 6:10 pm


-----------------------------------
This would be the third time this week I've been asked to explain that.  

http://www.compsci.ca/v2/viewtopic.php?p=93573#93573.

I feel bad about that explaination.  It's so terrible you might as well just take my word for it.  The point I did try to get across in that little expose is to experiment for yourself to see why.
