Is there anyone who can throw some insight into why this is happening?
I have two dice objects surrounded by several wall objects ( all of the same kind). All walls objects are 9x9 pixels with no apparent gaps between them. Both Dices (Dies) and wall objects have collision events on them, the dice being controlled by timelines and code. The objects are all on the same level and are all solid with precise collision.
My problem is that occasionally one of the dice goes through the wall. Has anyone any idea why this is happening and how I can correct it.
Might it have something to do with the mask being a square and the sprite being within the mask, in a rolling state.( 9 sub images) The mask is set at precise.
Thanks in advance
- Game Maker Community
- → Viewing Profile: Topics: DeeVeeGee
DeeVeeGee
Member Since 11 Sep 2010Offline Last Active Dec 09 2012 08:31 PM
Community Stats
- Group GMC Member
- Active Posts 14
- Profile Views 1331
- Member Title GMC Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
0
none
Friends
DeeVeeGee hasn't added any friends yet.
Topics I've Started
Dice goes walkabout
20 September 2012 - 06:54 PM
What's the next move?
13 July 2012 - 01:54 PM
Hi there, ( IbeaNewbe here. No, not really my name, but I think I ought to be calling myself that)
Can somebody help me please ?
I am trying to overcome two problems.
1) I have a working code ( all defined within a Selector_obj ) which toggles between 3 images of one sprite. I wish to add a further image to this sprite. So far I have ...
In the create event image_speed = 0
In global mouse left
if image_index=0 { instance_create ( mouse_x,mouse_y, obj_Rax)}
if image_index=1 { instance_create ( mouse_x,mouse_y, obj_Gax)}
if image_index=2 { instance_create ( mouse_x,mouse_y, obj_Bax)}
In global mouse right
position_destroy (mouse_x, mouse_y)
In the mouse wheel up event
If image_index = 2
{
image_index = 1
}
else
{
image_index = 0
}
And on the mouse wheel down event this code
if image_index = 0
{
image_index = 1
}
else
{
image_index = 2
}
This works fine but when I try to add to the code to include a fourth image, like this….
If image_index = 3
{
image_index = 2
}
else
{
image_index = 1
}
else
{
image_index = 0
}
An error is thrown at the second else. I have tried else if and then , even and, but I can’t get past this barrier.
How should I correct this?
Next question
2) I have managed to instance_create different sprite colours ( red, green and blue instances ) of the same instance ( question 1 above is my quest to add a yellow sprite to this) but I would like to instance_create a different object sprite, once again in the same four colours. So,
Can I do this from within the same Selector_obj if I change the global mouse right instruction (position_destroy (mouse_x, mouse_y)) to instance_create instructions for a different object ( and instances ) ?
Sorry the question was so convoluted. DeeVeeGee
Can somebody help me please ?
I am trying to overcome two problems.
1) I have a working code ( all defined within a Selector_obj ) which toggles between 3 images of one sprite. I wish to add a further image to this sprite. So far I have ...
In the create event image_speed = 0
In global mouse left
if image_index=0 { instance_create ( mouse_x,mouse_y, obj_Rax)}
if image_index=1 { instance_create ( mouse_x,mouse_y, obj_Gax)}
if image_index=2 { instance_create ( mouse_x,mouse_y, obj_Bax)}
In global mouse right
position_destroy (mouse_x, mouse_y)
In the mouse wheel up event
If image_index = 2
{
image_index = 1
}
else
{
image_index = 0
}
And on the mouse wheel down event this code
if image_index = 0
{
image_index = 1
}
else
{
image_index = 2
}
This works fine but when I try to add to the code to include a fourth image, like this….
If image_index = 3
{
image_index = 2
}
else
{
image_index = 1
}
else
{
image_index = 0
}
An error is thrown at the second else. I have tried else if and then , even and, but I can’t get past this barrier.
How should I correct this?
Next question
2) I have managed to instance_create different sprite colours ( red, green and blue instances ) of the same instance ( question 1 above is my quest to add a yellow sprite to this) but I would like to instance_create a different object sprite, once again in the same four colours. So,
Can I do this from within the same Selector_obj if I change the global mouse right instruction (position_destroy (mouse_x, mouse_y)) to instance_create instructions for a different object ( and instances ) ?
Sorry the question was so convoluted. DeeVeeGee
All ID instances change
05 July 2012 - 04:44 PM
Hi Everyone,
Can you help me with a small problem?
Although I put this in an object (obj_Wax) all instances of a different sprite created in its place insist on all changing to the same colour. Anybody?
Thanks in advance.
my code
across = obj_Wax; // this is the object name for a Blue Axe sprite ( plus Green, Red and Yellow)
// (100049) is the sprite instance_id for White Axe sprite, which is slightly
// larger than rest of sprites so that other sprites can be laid onto it.
spr1 = obj_Bax
spr2 = obj_Gax
spr3 = obj_Rax
spr4 = obj_Yax
if keyboard_check(ord ("B")) and place_free(x,y)
{
instance_create (x,y,spr1)
}
if keyboard_check(ord ("G")) and place_free(x,y)
{
instance_create (x,y,spr2)
}
else if keyboard_check (ord ("R"))and place_free(x,y)
{
instance_create (x,y,spr3)
}
else if keyboard_check (ord ("Y"))and place_free(x,y)
{
instance_create (x,y,spr4)
}
// #I have a problem in that ALL obj_Wax instances change to the same colour
// as each different key is pressed, where I wish that only the sprite selected
// should change.( the other insstances IDs are 100050, 100045, 100046, 100047,
// 100048, 100052, 100051. these are the order that they were created in.)
Can you help me with a small problem?
Although I put this in an object (obj_Wax) all instances of a different sprite created in its place insist on all changing to the same colour. Anybody?
Thanks in advance.
my code
across = obj_Wax; // this is the object name for a Blue Axe sprite ( plus Green, Red and Yellow)
// (100049) is the sprite instance_id for White Axe sprite, which is slightly
// larger than rest of sprites so that other sprites can be laid onto it.
spr1 = obj_Bax
spr2 = obj_Gax
spr3 = obj_Rax
spr4 = obj_Yax
if keyboard_check(ord ("B")) and place_free(x,y)
{
instance_create (x,y,spr1)
}
if keyboard_check(ord ("G")) and place_free(x,y)
{
instance_create (x,y,spr2)
}
else if keyboard_check (ord ("R"))and place_free(x,y)
{
instance_create (x,y,spr3)
}
else if keyboard_check (ord ("Y"))and place_free(x,y)
{
instance_create (x,y,spr4)
}
// #I have a problem in that ALL obj_Wax instances change to the same colour
// as each different key is pressed, where I wish that only the sprite selected
// should change.( the other insstances IDs are 100050, 100045, 100046, 100047,
// 100048, 100052, 100051. these are the order that they were created in.)
GM for Board Games ?
29 June 2012 - 02:57 PM
Does GM really cater for Board Games?
As a novice I ask this question because at the moment I have a game board made. I can manually D&D items to their positions on the board and the game can be played by 2-4 players, each using the same mouse and all on a left click and release.
Turn order is 1,2,3,4 or 2,3,4,1 or 3,4,1,2 or 4,1,2,3. It is always in that sequence of turns.
Each player has their own colour 1is Gold, 2 is Silver, 3 is Purple and 4 is Black. Each players colour is indicated on a shield.
Certain items have to be placed on the board by all players into their correct positions. For example, a Sword or a Goblet etc of that players colour. However, this meant providing each player with their own individual sets of items (18 * 8 different angles) each in their own colours.
I have a dice/ counter which indicates the number of times a player can attempt to place their item in the correct position.
Now all this is fine and works well because it is all being done manually, but, I need to get my logic right before I can proceed towards finishing the game.
After clicking on the dice and receiving say 4 go’s, what I need to do is to be able to select one shield (red), click on it and then select a sword ( or other item ) Then go to the position on the board that I think the sword will fit and do an instance_create (mouse_x, mouse_y, obj_redsword270, or whatever angle is appropriate) where I left click and release with the mouse and continue doing this until my turns are finished.
Therefore my questions are……..
1) Can I easily get 2, 3 or 4 players to follow in turn, whilst at the same time allowing them to have a different number of attempts to place their items on the board?
2) Can I make the obj_GoldSheild disable all of the other shields while that player completes their number of attempts and after that enable all shields again?
3) Would using the Switch command be the right way to proceed?
I would welcome any hints as to which direction I should go to achieve my aims.
DeeVeeGee
As a novice I ask this question because at the moment I have a game board made. I can manually D&D items to their positions on the board and the game can be played by 2-4 players, each using the same mouse and all on a left click and release.
Turn order is 1,2,3,4 or 2,3,4,1 or 3,4,1,2 or 4,1,2,3. It is always in that sequence of turns.
Each player has their own colour 1is Gold, 2 is Silver, 3 is Purple and 4 is Black. Each players colour is indicated on a shield.
Certain items have to be placed on the board by all players into their correct positions. For example, a Sword or a Goblet etc of that players colour. However, this meant providing each player with their own individual sets of items (18 * 8 different angles) each in their own colours.
I have a dice/ counter which indicates the number of times a player can attempt to place their item in the correct position.
Now all this is fine and works well because it is all being done manually, but, I need to get my logic right before I can proceed towards finishing the game.
After clicking on the dice and receiving say 4 go’s, what I need to do is to be able to select one shield (red), click on it and then select a sword ( or other item ) Then go to the position on the board that I think the sword will fit and do an instance_create (mouse_x, mouse_y, obj_redsword270, or whatever angle is appropriate) where I left click and release with the mouse and continue doing this until my turns are finished.
Therefore my questions are……..
1) Can I easily get 2, 3 or 4 players to follow in turn, whilst at the same time allowing them to have a different number of attempts to place their items on the board?
2) Can I make the obj_GoldSheild disable all of the other shields while that player completes their number of attempts and after that enable all shields again?
3) Would using the Switch command be the right way to proceed?
I would welcome any hints as to which direction I should go to achieve my aims.
DeeVeeGee
- Game Maker Community
- → Viewing Profile: Topics: DeeVeeGee
- Privacy Policy
- GMC Rules and Forum Rules ·



Find content