tsk it dosnt work or its just my pc?

Previous topic - Next topic

Hb!

Sorry to bother in that way... ( I imagine you're gonna start having nightmares with me ja) but since I downloaded the last version of Glbasic.... this simple code doesn't appear to work do you know why?...   or is it really that it only happens with me?
Code (glbasic) Select
WHILE TRUE
         delta=delta+1
         IF delta>10
         ani=1-ani
         ani=2-ani
         delta=0
         ENDIF
         DRAWSPRITE ani, -20, 255
         SHOWSCREEN
         WEND
do you have any idea how to replace it ad yes sorry I dind find ouy how to apply..
Code (glbasic) Select
y = y+1
   DRAWSPRITE 100, 100, y
   SHOWSCREEN
goto main

Kitty Hello

in the first example, "ani" will count from 0 to infinite. (PRINT ani,0,0)

Usually you want an animation from 0...5 (e.g.), then write:
Code (glbasic) Select
ani = MOD(ani + 1, 6) // will make ani from 0 to 5if you have a ping-pong (0,1,2,3,2,1,...) animation, do this:

Code (glbasic) Select
GLOBAL pingpong[]
DIMDATA pingpong[], 0,1,2,3,2,1
...
ani=ani+1
showani = pingpong[MOD(ani, LEN(pingpong[]) )]
This might seem a bit complicated in the first. Make sure you know what the MOD command does and then try to understand what I did.

Hb!

Got it Thanks again... What would I do without Your help? Tsk gotta stop bothering people... disgracefully  ani = mod (ani+1, 6 )
works only with while true.. and that takes the animation out of your hands

Kitty Hello

Uhm... only within while true... sure, your game needs a main loop. Or, uhm... er... OK?

Hb!

Is There any way to control it the animation with ani= mod (ani+1 , 6) ? and by the way there isn't a way to stop the infinite number in
Code (glbasic) Select
WHILE TRUE
           delta=delta+1
           IF delta>10
           ani=1-ani
           ani=2-ani
           endif
           wend
? or any better way to make the animations?

Hb!

tsk I could have found this before ~~ boku no baka...
Code (glbasic) Select
FOR n=0 TO 3

DRAWSPRITE n, 100, 100

SHOWSCREEN
NEXT
you can give values to n from 1 to the infinite and it gives you the animation anyways... and by the way this one doesn't cause the problem I had of the error window , and you can repeat this with another variable , I think it ill work excellent.... what do you think about it? and just one question if you compile this code a blue line is drawn? in my case it doesn't matter(its covered by the demo sign) by the moment, but what would happen with the full version? and do you think that a transparent line in that place would fix it?

Moru

The blue line should be the time left until the demo exits, you only have 2 minutes to test your game. That one will be gone together with the demo sign when you buy the licence