Jump to content


Zoltan Kriven

Member Since 16 Apr 2011
Offline Last Active Jun 16 2013 05:20 PM

Topics I've Started

Object Placement Code, Need Help

16 June 2013 - 03:30 PM

I'm trying to come up with a code to place a certain object in my game. As it is a mining game I need my dirt object to be placed in every square of my grid. My dirt object is 32X32 px. and when run over by digger it crumbles. My play field is 32000X32000. That's 1000X1000 squares, you see the problem here. I've tried coding to place them so I don't have to place all 1 million by hand and here is what I've come up with so far.

 

{
if xx < room_width-32 && yy < room_height-32

    {
    instance_create(0,0,object1);
    xx += 32;
    x = xx;
    y = yy;
    }
if xx = room_width-32 && yy < room_height
    {
    instance_create(0,0,object1);
    yy += 32;
    xx = 0;
    x = xx;
    y = yy;
    }
if xx < room_width-32 && yy = room_height-32
    {
    instance_create(0,0,object1);
    xx += 32;
    x = xx;
    y = yy;
    }
}

 

The problem I run into with this code is it will create the object, move to the next square and create another, when it reaches the end of the row, it goes to the next row. Everything is fine until it gets to the last row. On the last row, it will only create the object in the first 2 spaces. I need it to create in all spaces. ANY help would be appreciated.


looking for a programer and an artist

22 January 2013 - 05:35 PM

The name of the game is 10,000. You roll 6 dice to try to get as many points as possible. As long as you get points, you get the option to roll again. You must get at least 500 points to get on the board the first time. If you roll no points you bust and it is the next player's turn. First one to 10,000 wins.
PM me for further details.

This game will be freeware
No payment is available for this project.

Programmer needed
Artist needed

realistic pinball physics

17 January 2013 - 09:54 PM

I've never made a pinball game before. There are a couple of things I need to know. First off, a two part question, how many sub-images should the flipper sprites have, and should they have seperate collision masks?

Next, what should I put in the ball object to make it look like realistic physics, because just using the bounce and making it at precice angles looks a little off to me. My gravity for the ball is currently set to 0.2 at direction 270 (down). With these settings, it just doesn't look right.

Any suggestions?

Exp. Health bar question

21 December 2012 - 07:38 PM

I need my healthbar to show current experience out of experience needed to level up. Is there a way to do this?
My vars are: global.Exp, global.Level_Up.
global.Level_Up should be like Max health and the global.Exp should be like current health. I know I can just anchor the health bar to the opposite side, but that doesn't fix the having 2 vars in 1 health bar issue.

can you make time pass in 2 rooms at the same time

12 December 2012 - 09:33 PM

I have a plant growing game I'm working on. I want to have multiple levels or fields that you can grow crops in. Christmas trees take 100 seconds to grow. When I switch rooms, then come back to the same room, the time picks back up where it left off when I exited the room instead of counting down while I'm in the next room. Is there a way around this?
right now I set grow time to 3000 use grow_time-= 1 in the step event then I draw var:(grow_time/30). The room is persistent so the objects stay in the room, but when I go to room1, room0 pauses. I've noticed time handling functions in the manual, but I've no clue how to use them.