Jump to content


bigpaul

Member Since 02 Apr 2012
Offline Last Active Jul 04 2012 11:49 PM

Topics I've Started

problems with my gear shifting in platform

12 June 2012 - 03:55 PM

so far i cant get the player to "shift" when the speedometer is all the way maxed out. i have tried if global.dickspeed_accele is equal to global.dickspeed_max add 7 to global.dickspeed_max. i tried it in the V keyboard pressed check event however it doesnt work. if i hold the v key the player accelerates and the global.dickspeed_max keeps getting bigger and the player keeps accelrating. however the "up" key which is the gas key never speeds the player up realitve to the global.dickspeed_max, always the starting global.dickspeed_max. i would like the fix this. any help would be great.
i am making a motocross type game and im having trouble shifting, this is my code for the control object that will be in all rooms,
create event of control object

//dicksgobalvariables
global.dickspeed_accele=0.5
global.dickspd_fric=0.1
global.dicklevel_speed=.001
global.dickspeed_max=16*2
global.dickgrav=.5
global.dickang_fric=1

this is my speedomter code to make the player know when it is time to shift..

Create Event:
execute code:

//change these
_max = global.dickspeed_max;
_amount = global.dickspeed_accele;

//dont change these
_percent = 0;

_point_x = x;
_point_y = y;


Step Event:
execute code:

//calculate the angle
_angle = -(180*(_amount/_max)-180);

//adjust the 100 to suit how long you want the "hands" of your speedometer
_point_x = x + lengthdir_x(100,_angle);
_point_y = y + lengthdir_y(100,_angle);

//calculate the percentage
_percent = (_amount/_max)*100;

//make sure you can't get less than 0 or greater than the maximum value
if (_amount <= 0)
{
_amount = 0;
}

if (_amount >= _max)
{
_amount = _max;
}

Keyboard Event for <no key> Key:
set variable _amount relative to -2

Keyboard Event for <Up> Key:
set variable _amount relative to 2

Keyboard Event for <Down> Key:
set variable _amount relative to -2


and finally my player up (gas key) button code.
Keyboard Event for <Up> Key:
if at relative position (0,4) there is object obj_ground
      if hspeed is smaller than global.dickspeed_max
      set the horizontal speed relative to global.dickspeed_accele


so far i cant get the player to "shift" when the speedometer is all the way maxed out. i have tried if global.dickspeed_accele is equal to global.dickspeed_max add 7 to global.dickspeed_max. i tried it in the V keyboard pressed check event however it doesnt work. if i hold the v key the player accelerates and the global.dickspeed_max keeps getting bigger and the player keeps accelrating. however the "up" key which is the gas key never speeds the player up realitve to the global.dickspeed_max, always the starting global.dickspeed_max. i would like the fix this. any help would be great.

image angle question slash help

02 June 2012 - 09:19 PM

hello, im making a moto cross game and im trying to make it so if you land on a ramp at a angle that would cause a crash in real life.

this is the code im using

//keep image_angle in-between 0 and 360. So it is easer to make the
//physics. And only let the player rotate 90. It can't handle 360
if(image_angle<0){image_angle+=360}
if(image_angle>360){image_angle-=360}
if(image_angle>90&&image_angle<180){image_angle=90}
if(image_angle<(270)&&image_angle>180){image_angle=270}


this is what i do when i am in air to make player lean forward to correct the angle of desent

Keyboard Event for D-key Key:
if relative position (0,6) is collision free for All objects
      execute code:

angle_speed=-5

else
      exit this event



ive tried to duplicate this Keyboard Event for A-key Key:
execute code:

angle_speed=+5

if image_angle is larger than 65
      change the instance into object dickscrashedmower, yes performing events

that in the collison event, using but its not working, all it does is crash everytime it goes up a hill..

and this is the whole object details if you need them..

Information about object: dickplayer

Sprite: spr_abrams
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: playerparent
Mask: <same as sprite>

Create Event:
execute code:

//torque
angle_speed=0
//the angle of the ground at the position of the player
ground_angle=0

execute code:

cantrick=0

execute code:

inair=0

COMMENT: physics settings
set variable ang_fric to 0.1
set variable spd_fric to 0.1
set variable level_speed to .005
set variable speed_max to 16
set variable speed_accele to 1
set variable grav to .5

Step Event:
COMMENT: gravity
set the vertical speed relative to grav
execute code:

var ang;
//friction
angle_speed-=sign(angle_speed)*ang_fric
speed-=sign(speed)*spd_fric
//level out
ang=image_angle
if(ang>180){ang-=360}
angle_speed-=ang*level_speed

execute code:

//the angle of the ground at possitions x
var x1,y1,x2,y2;
x1=x-18
y1=y-64
x2=x+18
y2=y-64
repeat(120)
{
if(!instance_position(x1,y1,obj_ground))
y1+=1
if(!instance_position(x2,y2,obj_ground))
y2+=1
}
ground_angle=point_direction(x1,y1,x2,y2)

execute code:

//physics for collision with the ground
repeat(32)
{
if(instance_position(pointx(18,6),pointy(18,6),obj_ground))
  {
    motion_add(ground_angle+90,.5);
    x+=lengthdir_x(1,ground_angle+90);
    y+=lengthdir_y(1,ground_angle+90);
    image_angle+=1;
    angle_speed+=1;
  }
if(instance_position(pointx(-18,6),pointy(-18,6),obj_ground))
  {
    motion_add(ground_angle+90,.5);
    x+=lengthdir_x(1,ground_angle+90);
    y+=lengthdir_y(1,ground_angle+90);
    image_angle+=-1;
    angle_speed+=-1;
  }
}
image_angle+=angle_speed



execute code:

//keep image_angle in-between 0 and 360. So it is easer to make the
//physics. And only let the player rotate 90. It can't handle 360
if(image_angle<0){image_angle+=360}
if(image_angle>360){image_angle-=360}
if(image_angle>90&&image_angle<180){image_angle=90}
if(image_angle<(270)&&image_angle>180){image_angle=270}

      if relative position (0,0) gives a collision with Only solid objects
            set variable cantrick to 0
      set variable inair to 0
      else
            set variable inair to 1
      set variable cantrick to 1

Keyboard Event for A-key Key:
execute code:

angle_speed=+5

if image_angle is larger than 65
      change the instance into object dickscrashedmower, yes performing events

Keyboard Event for D-key Key:
if relative position (0,6) is collision free for All objects
      execute code:

angle_speed=-5

else
      exit this event

Keyboard Event for S-key Key:
if at relative position (0,4) there is object obj_ground
      if hspeed is smaller than speed_max
      set the horizontal speed relative to speed_accele

Keyboard Event for F11 Key:
if at relative position (0,4) there is object obj_ground
      if hspeed is larger than -speed_max
      set the horizontal speed relative to -speed_accele

Draw Event:
execute code:

//image_angle=mouse_x
draw_sprite_ext(sprite_index,image_index,x,y,1,1,image_angle,image_blend,image_alpha)



Key Press Event for C-key Key:
change the instance into object nohander, yes performing events

Key Press Event for X-key Key:
change the instance into object dickhartattack, yes performing events

Key Press Event for Z-key Key:
change the instance into object dickmarchtrick, yes performing events


im stumped. thanks folks.

image angle question

02 June 2012 - 09:01 PM

hello, im making a moto cross game and im trying to make it so if you land on a ramp at a angle that would cause a crash in real life.

this is the code im using

//keep image_angle in-between 0 and 360. So it is easer to make the
//physics. And only let the player rotate 90. It can't handle 360
if(image_angle<0){image_angle+=360}
if(image_angle>360){image_angle-=360}
if(image_angle>90&&image_angle<180){image_angle=90}
if(image_angle<(270)&&image_angle>180){image_angle=270}


this is what i do when i am in air to make player lean forward to correct the angle of desent

Keyboard Event for D-key Key:
if relative position (0,6) is collision free for All objects
execute code:

angle_speed=-5

else
exit this event



ive tried to duplicate this Keyboard Event for A-key Key:
execute code:

angle_speed=+5

if image_angle is larger than 65
change the instance into object dickscrashedmower, yes performing events

that in the collison event, using but its not working, all it does is crash everytime it goes up a hill..

and this is the whole object details if you need them..

Information about object: dickplayer

Sprite: spr_abrams
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: playerparent
Mask: <same as sprite>

Create Event:
execute code:

//torque
angle_speed=0
//the angle of the ground at the position of the player
ground_angle=0

execute code:

cantrick=0

execute code:

inair=0

COMMENT: physics settings
set variable ang_fric to 0.1
set variable spd_fric to 0.1
set variable level_speed to .005
set variable speed_max to 16
set variable speed_accele to 1
set variable grav to .5

Step Event:
COMMENT: gravity
set the vertical speed relative to grav
execute code:

var ang;
//friction
angle_speed-=sign(angle_speed)*ang_fric
speed-=sign(speed)*spd_fric
//level out
ang=image_angle
if(ang>180){ang-=360}
angle_speed-=ang*level_speed

execute code:

//the angle of the ground at possitions x
var x1,y1,x2,y2;
x1=x-18
y1=y-64
x2=x+18
y2=y-64
repeat(120)
{
if(!instance_position(x1,y1,obj_ground))
y1+=1
if(!instance_position(x2,y2,obj_ground))
y2+=1
}
ground_angle=point_direction(x1,y1,x2,y2)

execute code:

//physics for collision with the ground
repeat(32)
{
if(instance_position(pointx(18,6),pointy(18,6),obj_ground))
{
motion_add(ground_angle+90,.5);
x+=lengthdir_x(1,ground_angle+90);
y+=lengthdir_y(1,ground_angle+90);
image_angle+=1;
angle_speed+=1;
}
if(instance_position(pointx(-18,6),pointy(-18,6),obj_ground))
{
motion_add(ground_angle+90,.5);
x+=lengthdir_x(1,ground_angle+90);
y+=lengthdir_y(1,ground_angle+90);
image_angle+=-1;
angle_speed+=-1;
}
}
image_angle+=angle_speed



execute code:

//keep image_angle in-between 0 and 360. So it is easer to make the
//physics. And only let the player rotate 90. It can't handle 360
if(image_angle<0){image_angle+=360}
if(image_angle>360){image_angle-=360}
if(image_angle>90&&image_angle<180){image_angle=90}
if(image_angle<(270)&&image_angle>180){image_angle=270}

if relative position (0,0) gives a collision with Only solid objects
set variable cantrick to 0
set variable inair to 0
else
set variable inair to 1
set variable cantrick to 1

Keyboard Event for A-key Key:
execute code:

angle_speed=+5

if image_angle is larger than 65
change the instance into object dickscrashedmower, yes performing events

Keyboard Event for D-key Key:
if relative position (0,6) is collision free for All objects
execute code:

angle_speed=-5

else
exit this event

Keyboard Event for S-key Key:
if at relative position (0,4) there is object obj_ground
if hspeed is smaller than speed_max
set the horizontal speed relative to speed_accele

Keyboard Event for F11 Key:
if at relative position (0,4) there is object obj_ground
if hspeed is larger than -speed_max
set the horizontal speed relative to -speed_accele

Draw Event:
execute code:

//image_angle=mouse_x
draw_sprite_ext(sprite_index,image_index,x,y,1,1,image_angle,image_blend,image_alpha)



Key Press Event for C-key Key:
change the instance into object nohander, yes performing events

Key Press Event for X-key Key:
change the instance into object dickhartattack, yes performing events

Key Press Event for Z-key Key:
change the instance into object dickmarchtrick, yes performing events


im stumped. thanks folks.

Lawn Mower X Games!

31 May 2012 - 11:17 PM

[u]LINK NOW FIXED[/u]



works with vista
is is a exe file, zipped.
does not change resoultion.
basic engine.


The Demo from yoyogames

the hosta mirror


okay so i tried to make this game today and came up with a small demo...
who loves lawn mowers? who loves the X games? think tricks and physics with lawn mowers! follow "Slick" Dick Willams on his quest for lawn mower gold! Currently features 3 tricks, use ZXC to do them. features two runs and going to feature ai and maybe some actual racing and a select screen. thanks for playing. Also i need to know if i should continue this or not.


please be gentle, its my first game.

Posted Image

image angle help

31 May 2012 - 05:17 PM

hello. im making a motocross game, i have a great engine im working off of. i have it so that the motocross racer moves 360 degrees one image at a time, however, i want it where if the racer is coming down of a ramp at a angle that would cause a crash in real life, well, cause a crash, however if i use the sprite number function (forgot what it is called) in a collison with the block im sure it will constantly crash going up a hill, does everyone get what i mean?