1 decade ago
by rk8479
i want to create a game where i click the screen and it creates a box in the centre and if you tilt the device the block moves with it.
any help would be appreaciated
1 decade ago
by dominic
Heya, please don't take this personally, but there's a reason this thread has been unanswered for 2 days now. People in this forum are generally really really helpful and often spend a lot of time helping others. However, no one is going to write a game for you.
Tell us what you already tried and what specifically you are struggling with. It's far easier to help you with specific problems.
Anyway, here are some pointers to your problem:
To check for mous input, use
ig.input and bind the
ig.KEY.MOUSE1
button to an action. You can then use
ig.input.pressed()
to check for that action.
The center of the screen can be easily computed with the width and height:
var centerX = ig.system.width / 2;
var centerY = ig.system.height / 2;
You can than create an entity at that position using
ig.game.spawnEntity().
Accelerometer Input, again, is capsuled in
ig.input. Just read the acceleration and set your entities velocity accordingly.
I hope that helps a bit.
Page 1 of 1
« first
« previous
next ›
last »