I have another small problem. I'd like to create clickable buttons, so my game could be playable on touchscreens. I created a cursor; a simple model which draws a sprite and updates the following code :
Code: Select all
CurrentModel.Position.X = SmallballHD.MousePosition.X*8;
CurrentModel.Position.Y = SmallballHD.MousePosition.Y*4.5;
The button is a similar model with a sprite, with a KeyPress action set to register at MouseLeft ( { ). If mouseleft is pressed, this code is executed :
Code: Select all
if (CurrentModel.CollidedWith.Category==11); {
GameMode=0;
@SetAppState(State : InGame);
@RemoveModel();
}
For some reason, this crashes the entire game. How would I do a clickable button?