SemiMetalAlchemist icon

obj_crops_meta Step Event

SemiMetalAlchemist | PRO | 03/24/18 01:33:59 AM UTC | 0 ⭐ | 10190 👁️ | Never ⏰ | []
Game Maker |

0 B

|

None

|

0 👍

/

0 👎

/// @description 
// You can write your code in this editor
if(room != room_outside){ planting = false; exit; }     ///Only allowed to plant in outisde room
 
 
 
#region Planting
if(keyboard_check_pressed(ord("P"))){planting = !planting }
 
if(planting){
    mx = mouse_x;
    my = mouse_y;
    
    if(mouse_wheel_up()) selectCrop += 1;
    if(mouse_wheel_down()) selectCrop -= 1;
    
    if(selectCrop > sprite_get_number(spr_crops_picked)-1)  {   selectCrop = 0;}
    else if (selectCrop <0) {selectCrop = sprite_get_number(spr_crops_picked)-1; }
    if (mouse_check_button_pressed(mb_left)){
        instance_create_crop(mx, my, selectCrop);
    }
}
#endregion
 
if(instance_exists(obj_crops) and keyboard_check_pressed(ord("G"))){
        with(obj_crops){
            if(growthStage < maxGrowthStage){
            daysOld += 1;
            
            //First Growth
            var firstGrowth = 0;
            if(daysOld > 0){ firstGrowth = 1; }
            
            
            growthStage = firstGrowth + daysOld div growthStageDuration;
            } else {
                growthStage = maxGrowthStage;
                fullyGrown = true;
                alarm[1] = 1;
        }
}
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎