Updated to 1.1, includes lots of bug fixes including a hack to significantly improve collision detection. Right now it's only applied to the lasers and not the player. Can't wait for gQ .7!!!
Nicely done. I'm in process of designing my first game. But what If I want movement controls on WASD keys and also on the directional keypad with arrows? Is that possible with game query? I want to give users the option of moving their character from the left side of the space bar or the right side. Also is there performance lag by having the cat move any faster around the screen?
Thanks for giving me any insight as I dive into my gaming development!
Yes it's possible and doesn't change you code much. most of the case you have a switch or cascading ifs, something like this if you use the key tracker (it would be almost the same with event base control):
if($.gQ.keyTracker[65]){//this is left! (a) bluePosX -=3; } if($.gQ.keyTracker[87]){//this is up! (w) bluePosY -=3; } if($.gQ.keyTracker[68]){//this is right (d) bluePosX +=3; } if($.gQ.keyTracker[83]){//this is down! (s) bluePosY +=3; }
To add the arrow key to this just write: (for left for example):
if($.gQ.keyTracker[65]|| $.gQ.keyTracker[37]){//this is left! (a or left-arrow) bluePosX -=3; }
Comments
Thanks for giving me any insight as I dive into my gaming development!
switch
or cascadingif
s, something like this if you use the key tracker (it would be almost the same with event base control):To add the arrow key to this just write: (for left for example):