moving sprites down

Blitz3D Forums/Blitz3D Programming/moving sprites down

Rook Zimbabwe(Posted 2005) [#1]
I have played the heck out of Treasurefall... Highscore is about 78920... And I want to know...

1. This was coded in Blitz correct?
2. How did they move the sprites in the array down? I can move the muse while this animation is going on so it isn't a while/wend... is it?

Any opinions?

RZ


jfk EO-11110(Posted 2005) [#2]
I don't know the game, but from what you say it sounds like Polling-based multitasking to me.

Polling based multitasking doesn't use real multitasking, but handles the multiple tasks timeline or event controlled.

A very simple example is:

while not keydown(1)
 y1=y1+15
 y2=y2+17
 if y1>200 then y1=0
 if y2>200 then y2=0
 positionentity s1,-1,y1,5
 positionentity s2, 1,y2,5
wend

y1 and y2 are moving individually and simultanously, but not with the same speed. Although it looks like the puter is doing both at the same time, it's doing it one by one.

This way you can do much more complex things, you only have to take care that none of the tasks will branch to an endless loop by its own and therefore freeze the polling loop.

Basicly all (pseudo-)Multitasking on the OS level is done this way, as long as it isn't processed by a coprocessor or non-cpu device. EG. the soundcard chip will play a WAV using direct access to the ram, so the CPU won't get dirty hands from the WAV at all, this is real Multitasking. But when you have to apps open (eg. two browserwindows), windows will handle the tasks by ONE cpu using polling as well (and maybe a few hardware interrupts). (Ok, there's also Dual Processors at the horizon, but they still poll - as long as you don't have a processor for each task)
Uh, I kind of doubt this will answer your question :) but - anyway, maybe it's useful.


Damien Sturdy(Posted 2005) [#3]
*poke* y2=y2=17? :P



@Rook, if you store youre mouse updates in a function, the mouse can be "multitasked" like that by simply running the update funciton where you need to move it.


Rook Zimbabwe(Posted 2005) [#4]
jfk... it is useful... it may even work.

The Treasurefall game you switch two objects in a field of objects (probably individual data strings) and try to make 3 (or more) in a row and then THOSE set that are matching are deleted and THEN the rows drop down to fill in the board... Is that more clear?

Probably not.

Cygnus ??? = 17 ??? :o

RZ