Jump to content


bowlda

Member Since 14 Apr 2009
Offline Last Active Feb 26 2013 03:33 PM

Topics I've Started

procedural generation?

28 September 2012 - 02:10 AM

I decided to give myself a little challenge and to make a little world generator. Im not really sure of the method post people use for this kind of thing, so i just started making my own. The map im making is a 30x30 one, and each little block of it is 16x16 pixels. Currently i can get a horizon (land and sky) to generate, but i would like to make sort of a hilly terrain. Im trying to get the land to fluctuate either one block up or one block down to get a hillish structure. Im trying to get the generator object that i made to check (using action_if_object) the column before it to see where the land is, and to generate another block either 1 block below or above. Currently that isnt working for me, and I would love some input/help on this! Also tell me if I'm using incorrect terminology to describe this, as it felt a bit hard to write! Thanks!

I will post what i have below:
Spoiler

platformer weapons

19 August 2012 - 06:44 PM

Hello!

I have been working on a platformer lately, and i have looked up a number of examples, but none have really answered my questions. I mainly just want to know how to use GML to equip a sword on my character without having to make new sprites for every weapon. Also, how would i get the weapon to move with my character's hand in every frame of its animation? Thanks!

Click to Place not working right

25 July 2012 - 12:02 AM

Alright so another problem on my little pet game ive been working on. So far i have a little pet that randomly walks about the screen, changing directions every so often. I have made a hunger meter for the pet, and when it drops, you simply click on a food icon and then click on the map and the pet will run towards it to eat it. So I made it to where when you click anywhere, the food appears. If the instance of the food exists, the pet runs towards the direction of the food, and stops when meeting it. I used the following code to orientate the pet's sprite to face the direction it will be going:
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"

its almost like its saying the instance doesnt exist, even though its clearly on the screen. If someone could help me on this thatd be great, thanks!

Collision and xscale isues [solved!]

13 July 2012 - 07:16 PM

Hello again!
I've come back with another issue in my little virtual pet game I've been making...
Basically, I've been making a pretty simple walking and collision code for the character (or pet) which is when it hits one of the 4 surrounding walls, it simple turns around and walks the opposite way. I also have a couple of randomly chosen alarms that signal when the pet either starts walking in an opposite direction, or stops walking all together (this isn't due to collision with any objects, its just random walking around the room). I only have a single tiny sprite so far, so when i want it to turn around, i use the image_xscale function (i use 2 to enlargen the object, its pretty small). There are two problems currently. 1. When the pet hits the wall and turns around, the sprite is flipped, but is INSIDE the wall before it moves out, like it completely mirrors it. 2. When the pet randomly changes directions in its walking, it will sometimes not change the sprites orientation with the xscale. Here is the code in the step event:

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
    }
    
    

I tried to be as thorough as possible, but if i can offer any more information, please tell me. Any help would be appreciated!

Changing the time span of an alarm? [SOLVED]

12 July 2012 - 04:32 AM

Hello, I was wondering if its possible to chang, or in this case, shorten an alarm after it has already started. in my game i have an object which an egg. I made an alarm which hatches it after, say, a minute. but if the player warms the egg (or clicks it....same thing) i want it to lessen the time until it hatches. Can anyone help me out? Thanks