Jump to content


Photo

Blowing Bombs With mouse click


  • Please log in to reply
28 replies to this topic

#1 DevilSir

DevilSir

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 27 February 2012 - 03:23 PM

Hi, im new here could anyone help me please?

I started a game and got some problems, i want to click the bomb and get highscore with delay and then restart the game. Here is Info box!
Information about object: obj_bomb_lvl2_1

Sprite: spr_bomb
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Create Event:
start moving in directions 000001000 with speed set to 5

Alarm Event for alarm 1:
show the highscore table
    background: <undefined>
     show the border
     new color: 255, other color: 0
     Font: "Times New Roman",10,0,0,0,0,0

Collision Event with object obj_wall:
bounce not precisely against solid objects

Mouse Event for Left Pressed:
set the sprite to spr_bomb with subimage 0 and speed 1
change the instance into object obj_explosion, not performing events
for all obj_bomb: set Alarm 1 to 15


:GM023: | :GM002:

:GM040: | :GM078:

:GM127: | :GM016:

:GM129: | :GM108: :GM025: :GM040:

Edited by DevilSir, 27 February 2012 - 04:01 PM.

  • 0

#2 NukeTheCat

NukeTheCat

    GMC Member

  • GMC Member
  • 461 posts
  • Version:GM8.1

Posted 27 February 2012 - 03:28 PM

Is this the information or did you actually add this into the 'execute code'?
  • 0

#3 Zealot644

Zealot644

    GMC Member

  • New Member
  • 266 posts
  • Version:GM8

Posted 27 February 2012 - 03:40 PM

OP, it sounds like you are doing the fruit tutorial...

Go back a few steps and follow it closely. It's pretty hard to mess up on.
  • 0

#4 DevilSir

DevilSir

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 27 February 2012 - 03:51 PM

Is this the information or did you actually add this into the 'execute code'?

this is the info box
  • 0

#5 DevilSir

DevilSir

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 27 February 2012 - 03:54 PM

OP, it sounds like you are doing the fruit tutorial...

Go back a few steps and follow it closely. It's pretty hard to mess up on.

yea its from fruit tutorial with my own version.
  • 0

#6 NukeTheCat

NukeTheCat

    GMC Member

  • GMC Member
  • 461 posts
  • Version:GM8.1

Posted 27 February 2012 - 03:56 PM

So what is actually the problem?
  • 0

#7 DevilSir

DevilSir

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 27 February 2012 - 03:57 PM

So what is actually the problem?

i click the bomb and i didnt get highscore
  • 0

#8 NukeTheCat

NukeTheCat

    GMC Member

  • GMC Member
  • 461 posts
  • Version:GM8.1

Posted 27 February 2012 - 04:09 PM

:GM129: Left click event for bomb:

:GM108: sprite_index
:GM025: obj_explosion
:GM041: sleep for 500 - this is equivalent to half a second
:GM078: show highscore table - i think you should add a background, just to be sure that is not the problem
:GM047: restart the game
  • 1

#9 DevilSir

DevilSir

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 27 February 2012 - 04:14 PM

:GM129: Left click event for bomb:

:GM108: sprite_index
:GM025: obj_explosion
:GM041: sleep for 500 - this is equivalent to half a second
:GM078: show highscore table - i think you should add a background, just to be sure that is not the problem
:GM047: restart the game

yea its working but i want to see the animated explosion first and then the score :/ now its like "click-BOO-Highscore" its cut the animation of bomb

Edited by DevilSir, 27 February 2012 - 04:15 PM.

  • 0

#10 NukeTheCat

NukeTheCat

    GMC Member

  • GMC Member
  • 461 posts
  • Version:GM8.1

Posted 27 February 2012 - 04:18 PM

Then put 'sleep for 500', 'show highscore' and 'restart the game' into the obj_explosion Create Event

Edit:
sorry, put it in the Animation End Event

Edited by Jlm07, 27 February 2012 - 04:20 PM.

  • 1

#11 DevilSir

DevilSir

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 27 February 2012 - 04:22 PM

Then put 'sleep for 500', 'show highscore' and 'restart the game' into the obj_explosion Create Event

Edit:
sorry, put it in the Animation End Event

LOOOOOOOL worked! a bit bugged though but worked

Edited by DevilSir, 27 February 2012 - 04:24 PM.

  • 0

#12 DevilSir

DevilSir

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 27 February 2012 - 04:27 PM

Thaaaaaaaaaaaaaaaaanks a lot jlm07!!!! you are the best !!! :turned: !! can i ask you something els :unsure:

Edited by DevilSir, 27 February 2012 - 04:28 PM.

  • 0

#13 NukeTheCat

NukeTheCat

    GMC Member

  • GMC Member
  • 461 posts
  • Version:GM8.1

Posted 27 February 2012 - 04:28 PM

Glad I could help. I you want the highscore table to show immediately after the explosion, you can take out the 'sleep for 500' action

EDIT:

Thaaaaaaaaaaaaaaaaanks a lot jlm07!!!! you are the best !!! !! can i ask you something els

OK, what is it?

Edited by Jlm07, 27 February 2012 - 04:34 PM.

  • 1

#14 DevilSir

DevilSir

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 27 February 2012 - 04:40 PM

I use in game custom cursor and when times up in game i set :GM044: times up - ok.. at this point my cursor is default :/ so it going default when i have to press "ok" button and then its custom again

Edited by DevilSir, 27 February 2012 - 04:45 PM.

  • 0

#15 NukeTheCat

NukeTheCat

    GMC Member

  • GMC Member
  • 461 posts
  • Version:GM8.1

Posted 27 February 2012 - 04:48 PM

Isn't that normal?

Edited by Jlm07, 27 February 2012 - 04:54 PM.

  • 1

#16 DevilSir

DevilSir

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 27 February 2012 - 04:57 PM

dunno :) if is that normal then ok
  • 0

#17 DevilSir

DevilSir

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 27 February 2012 - 05:00 PM

how about if i want to add fog of war at mouse? is that possible?
  • 0

#18 NukeTheCat

NukeTheCat

    GMC Member

  • GMC Member
  • 461 posts
  • Version:GM8.1

Posted 27 February 2012 - 05:24 PM

Yeah it's normal. Unless you create your own button
e.g. here is a very simple one:

To use this, create a new object and just paste this on the required events

Draw Event
//create a button sprite [ OK ]
draw_rectangle_color(x-48,y-50,x+48,y+10,c_ltgray,c_ltgray,c_gray,c_gray,0);
draw_sprite(button sprite,sprite_index,x,y);
/* you have to change 'button sprite' to the actual button's sprite, you can make it an animation to make it more attractive*/
/*this is used to draw a rectangle the given colour (light grey and grey) using the draw event causes the button's sprite to be overwritten so you have to draw it again*/ 

Left press event:
highscore_show(numb);
game_restart();
//you can change this to whatever action you want 
//highscore_show(numb) = show the highscore, numb means you can add new highscore if met the required condition 
// game_restart() = restart the game, duh. 

EDIT:
what's 'fog of war'?

Edited by Jlm07, 27 February 2012 - 05:26 PM.

  • 1

#19 DevilSir

DevilSir

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 27 February 2012 - 05:51 PM

___________________________________________
ERROR in
action number 1
of Mouse Event for Left Pressed
for object obj_own_button:

Error in code at line 1:
highscore_show(numb);
^
at position 16: Unknown variable numb
___________________________________________

Edited by DevilSir, 27 February 2012 - 05:52 PM.

  • 0

#20 DevilSir

DevilSir

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 27 February 2012 - 06:01 PM

what's 'fog of war'?
__________________


Something like this
Posted Image


Edited by DevilSir, 27 February 2012 - 06:08 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users