I will post what i have below:
Spoiler
Not Telling
28 September 2012 - 02:10 AM
earth = 0
for (y = 0; y<=480 && x<=480; y += 16)
{
if y = 480
{
y=0
x+=16
}
World_Gen()
if earth = 1 && y > 240
{
instance_create(x,y,objGreen)
}
if earth = 1 && y <= 240
{
instance_create(x,y,objBlue)
}
if earth != 1
{
instance_create(x,y,objBlue)
}
}
if y=240
{
earth = choose(1,2,3)
}
if y = 256
{
if action_if_object(objGreen,x-16,y-16) && action_if_object(objBlue,x,y-16)
{
earth = 0
}
}
19 August 2012 - 06:44 PM
25 July 2012 - 12:02 AM
if Food.x < pet.x
{
image_xscale=2
}
if Food.x > pet.x
{
image_xscale=-2 //original sprite is facing left
}
I set a alarm when the pet hits the food, and when the alarm goes off in a few seconds, the food instance should disappear. (i will be putting an eating animation here later). After the instance is destroyed, you are allowed to place another food down. I have two problems: When the pet hits the food, it immediately disappears, theres no wait time from the alarm like there should be. My second problem is sometimes after placing a food I will get the error message : "if Food.x < pet.x......." "Food.x does not exist"13 July 2012 - 07:16 PM
if place_meeting(x,y+1,objWall) //Collision code
{
motion_set(90,2)
PetDirection = 90
}
if place_meeting(x,y-1,objWall)
{
motion_set(270,2)
PetDirection = 270
}
if place_meeting(x+1,y,objWall3)
{
motion_set(180,2)
PetDirection = 180
}
if place_meeting(x-1,y,objWall2)
{
motion_set(0,2)
PetDirection = 0
}
if PetDirection = 0
{
PetOrientation = 1
image_xscale = -2
}
if PetDirection = 180
{
PetOrientation = 0
image_xscale = 2
}
12 July 2012 - 04:32 AM
Community Forum Software by IP.Board
Licensed to: YoYo Games Ltd

Find content