PDA

Click to See Complete Forum and Search --> : is it possible to make a little game


dimava
Oct 4th, 2000, 09:39 PM
I know I will have abosolultly no problem doing this in VB but in VB Script how do I make it so that the left and right key board keys move the character left and right, then food is flying at the character, and it tries to eat the food, and it gets points everytime it eats something.

is this even possible to do in vb script?

thanks in advance

HarryW
Oct 5th, 2000, 12:15 AM
Hmmm..... possible maybe, but not exactly easy. Usually this kind of thing is done with a Java Applet. I am pretty sure you can move images around and stuff, but I'm not sure if you can get keypresses like you can in VB.

Ben
Oct 6th, 2000, 05:24 AM
Use DHTML and VBscript you can no problem.

Look forthe events onKeypress() as it returns a keycode that you can translate for the arrow keys.

to move an image around the screen, use DHTML.

<div id="sprite" style="position:absolute; left:10; top:10;">
<img src="piccy.gif">
</div>

and script like so:

document.all["sprite"].style.pixelLeft = 30;
document.all["sprite"].style.pixelTop = 100;