Tower defense on Msx

Pagina 5/7
1 | 2 | 3 | 4 | | 6 | 7

Van Leo

Paragon (1236)

afbeelding van Leo

28-12-2010, 17:57

Van ARTRAG

Enlighted (6935)

afbeelding van ARTRAG

28-12-2010, 21:37

Nice work!

Van Leo

Paragon (1236)

afbeelding van Leo

28-12-2010, 23:11

thks !
next step is to define sprites with a bar for hit points and make them die when count =0 , not big deal
and after that define the rounds , just a little more time
finally improve gfx , boring to me
and ultimately add sfx
long way then !

Van RobertVroemisse

Paragon (1327)

afbeelding van RobertVroemisse

29-12-2010, 08:49

Great work! Love it.

Van Leo

Paragon (1236)

afbeelding van Leo

30-12-2010, 23:11

thks as well , now with hit point bar on monsters :
http://www.youtube.com/watch?v=Yqbo3JKdWeo

Van Hrothgar

Champion (479)

afbeelding van Hrothgar

31-12-2010, 09:26

What is the greatest bottleneck in speed on MSX2, the calculations or the actual sprite manipulation? I recall that putsprite is really slow compared to direct VDP commands and vpokes but that problem might as well be optimized already in this example.

Van Leo

Paragon (1236)

afbeelding van Leo

31-12-2010, 09:44

regular put sprite is used.
this is turbo basic or xbasic / basic kun
i think calculation are slow , sometimes i use operator like "*2" which could be optimized in asm .
i alsonoticed that at the begining i was using single/doubles forvariablesand using integers speeded
up the execution.
the main loop has two "for" loop with "if then else" , like this:
for monster=1 to 9
for tower =1 to 5
- three if statement
- tower to monster distance test, can be slow
- some gosubs if some condition true
next
next

i use "on key gosub" and "on interval gosub" which may slow down turbo basic ( though i have not noticed it)

Van Edwin

Paragon (1182)

afbeelding van Edwin

31-12-2010, 11:19

You could test if four "pokes" gives you a substantial gain over put sprite. Especially in basic kun this should compile to something that uses nearly no time at all. If that works, then you could use a 128 byte memory buffer for the sprite attribute table and have a small ML routine upload this to vram each vblank (see screen2 upload code on my site for an example implementation).
If it doesn't give you any gain, then you need to optimise other things. Like for instance your distance calculation.

Van Leo

Paragon (1236)

afbeelding van Leo

31-12-2010, 15:41

you mean 4 vpokes ? ok ill try .

Van ARTRAG

Enlighted (6935)

afbeelding van ARTRAG

31-12-2010, 17:11

you can do one vpoke and 3 out (&h98,value)
this saves even more
but if you write all spite in sequence you can do one vpoke and a bunch of outs saving a lot of cpu time

Pagina 5/7
1 | 2 | 3 | 4 | | 6 | 7