I am struggling to code something at the minute. I want an object to move to a position and then stop at that position. But each time the object is created the position it needs to go to may have changed, such as the player's position
Any help?
- Game Maker Community
- → Viewing Profile: Topics: greenall69
greenall69
Member Since 02 Mar 2006Offline Last Active Mar 15 2013 10:26 PM
Community Stats
- Group GMC Member
- Active Posts 186
- Profile Views 1908
- Member Title GMC Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
1
none
Topics I've Started
Move Towards A Point And Then Stops There
15 March 2013 - 10:15 PM
Room Wrapping
28 February 2013 - 02:33 AM

So this is essentially what i want to create. Does anyone know a good way to do this?
I have tried the standard room wrapping, move_wrap(hor,vert,margin). This works, but it literally teleports the player to the other side of the room.
Is there a more seemless way? Has anyone tried this before?
Expert programmer needed (paid)
23 September 2012 - 06:20 PM
I am in the process of producing a game called (working title) Rednecks. Vs. Aliens.

This is a screen shot from actual game play. The engine has been made, additional enemies/bosses need to be added and certain aspects of the engine need to be altered/bugs fixed.
There are a lot of features left to incorporate into the engine, what you see is only the very begging of the production of the game.
I require an expert programmer with good experience and a healthy portfolio. A very reasonable payment will be offered, with room to negotiate.

This is a screen shot from actual game play. The engine has been made, additional enemies/bosses need to be added and certain aspects of the engine need to be altered/bugs fixed.
There are a lot of features left to incorporate into the engine, what you see is only the very begging of the production of the game.
I require an expert programmer with good experience and a healthy portfolio. A very reasonable payment will be offered, with room to negotiate.
Implementing ladders into this engine
27 June 2012 - 05:35 PM
I am having trouble implementing ladders into this code. It is from the edmunns platformer engine. Every time i try to write something new the player floats around or becomes disabled. Would anyone take a look at this and try figure out how ladders could be implemented?
Origional engine http://gmc.yoyogames...howtopic=308521
// create event
//step event
Origional engine http://gmc.yoyogames...howtopic=308521
// create event
//variable you can change and effect the gameplay. //These should never change during gameplay //normal physics setup acc=0.23 deacc=0.18 maxvspeed=6.5 maxhspeed=3 //ice physics setup iceacc=0.1 icedeacc=0.05 maxicevspeed=5.5 maxicehspeed=5 //water physics wateracc=0.1 waterdeacc=0.34 maxwatervspeed=2 maxwaterhspeed=2 //jump setup jumps=1 maxjumpspeed=-12 jumpspeed=-4.8 //variable in play (do not change these variables!) _maxvspeed=5.5 _maxhspeed=5 _acc=0.23 _deacc=0.34 dir="right" global.h=0 duck=false die=false run=false facing=1 //control keys up=vk_up down=vk_down left=vk_left right=vk_right //other instance_create(0,0,obj_lives) //view position xx=x yy=y
//step event
//Thanks for choosing to use my engine!
//Although not advance, you may need some basic knowledge to see how it works.
//physics//
//ice physics//
if place_meeting(x,y+1,obj_ice) && !place_meeting(x,y,obj_water){
_acc=iceacc;
_deacc=icedeacc;
_maxvspeed=maxicevspeed
_maxhspeed=maxicehspeed}
//normal physics
if !place_meeting(x,y+1,obj_ice) && !place_meeting(x,y,obj_water){
_acc=acc;
_deacc=deacc;
_maxvspeed=maxvspeed
_maxhspeed=maxhspeed}
//water physics
if place_meeting(x,y,obj_water){
_acc=wateracc;
_deacc=waterdeacc;
_maxvspeed=maxwatervspeed
_maxhspeed=maxwaterhspeed;}
//slow the character when you want to//
if (!keyboard_check(right) and !keyboard_check(left)) or (keyboard_check(right) and keyboard_check(left)) or duck=true{
if global.h>0{
global.h-=_deacc;
global.h=max(global.h,0);}
if global.h<0{
global.h+=_deacc;
global.h=min(global.h,0);}}
//movement
//accelerate
if keyboard_check(right) && duck=false
{
dir="right"
global.h+=_acc;
facing=1
}
if keyboard_check(left) && duck=false
{
dir="left"
global.h-=_acc;
facing=0
}
repeat (abs(global.h))
{
if place_free(x+sign(global.h),y)
{
x+=sign(global.h);
if !place_free(x,y+2) && place_free(x,y+1)
y+=1;
} // add speed (no slope)
else
{
if place_free(x+sign(global.h),y-1)
{
y-=1; // add speed (with slope)
x+=sign(global.h);
}
else
{
global.h = 0;
break;
}
}
}
//tell if the player is moving//
if global.h=0{
run=false}
else{
run=true}
//limit horizontal speed//
global.h=min(_maxhspeed,max(global.h,-_maxhspeed));
vspeed=min(_maxvspeed,max(vspeed,maxjumpspeed));
//normal jump
if (keyboard_check_pressed(up)) && jumps=1 && duck=false{
if place_free(x,y+1){
if (keyboard_check(left) && !place_free(x-1,y)) or (keyboard_check(right) && !place_free(x+1,y)){
exit;}}
jumps-=1;
vspeed=jumpspeed}
//allow infinite jump when under water
if place_meeting(x,y,obj_water){
jumps=1;}
//put jumps to normal
if place_meeting(x,y+1,obj_wall){
jumps=1;}
//gravity//
gravity=place_free(x,y + 1)/5;
//duck//
if !place_free(x,y+1) && keyboard_check(down){
duck=true;
mask_index=msk_duck}
else{
duck=false;
mask_index=msk_normal}
//cant go left off the screen//
if x<0{
x=0;
global.h = 0;}
//end game when entering the next level//
if x>=room_width{
game_end();}
//die if you fall off the bottom of the screen//
if y>=room_height{
instance_change(obj_death,true);}
//limits off the top of the screen//
if y<0{
y=0;
vspeed=0}
//other
script_execute(scr_deactivate)
//end game if no lives left
if global._lives<1{
game_end();}
//view control
if xx<x then xx-=(xx-x)/16
if xx>x then xx+=(x-xx)/16
if yy<y then yy-=(yy-y)/16
if yy>y then yy+=(y-yy)/16
view_xview[0]=xx-320
view_yview[0]=yy-240
//background
script_execute(scr_background)
if (keyboard_check_pressed(ord("X")))
{
projectile=instance_create(x,y,obj_projectile); //Create a projectile and store it's identification number in the variable projectile.
switch (facing)
{
case 0:
projectile.direction=180; //Left
break;
case 1:
projectile.direction=0; //Right
break;
}
}
Slightly alter the course of an object
25 June 2012 - 05:27 PM
I am currently trying to fix a problem. I am trying to get a grenade which is traveling through the air, heading towards the ground to slightly alter its course depending where the player is. So basically, imagine a grenade being dropped from a great height away from the player. As its falling i want it to start moving above the player
At the moment i have this code
and this in the step event of the object bomb
The code in the step event of the grenade isnt working. Any help?
At the moment i have this code
if (image_index=14)
{
projectile=instance_create(x+7,y+3,obj_enemy_bomb);
{
projectile.direction=30;
projectile.speed=1;
projectile.gravity=0.11
}} //to set the general motion and direction of the thrown enemy bomb
and this in the step event of the object bomb
if obj_enemy_bomb.x > obj_player speed = 5
{
obj_enemy_bomb.x +=1}The code in the step event of the grenade isnt working. Any help?
- Game Maker Community
- → Viewing Profile: Topics: greenall69
- Privacy Policy
- GMC Rules and Forum Rules ·



Find content