Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: ENGINE for getting hurt  (Read 1590 times)

0 Members and 1 Guest are viewing this topic.
ENGINE for getting hurt
« on: August 01, 2009, 09:23:53 pm »
  • Make your best move ass-bite!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 139
 :huh: So I am working on a Zelda project called LoZ:Shadowed Prince and i need a code or an engine so if the player runs into an enemy he gets knocked back some without missing a collision and please make it GBC style and make hime motion back instead of jumping to a postion
« Last Edit: August 01, 2009, 11:08:04 pm by Bludleef »
Logged
Re: ENGINE for getting hurt
« Reply #1 on: August 01, 2009, 10:10:43 pm »
  • Make your best move ass-bite!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 139
Ok I really need I to proceed my game making just link getting knocked back when he touches an enemy please   :'(
 Do not double post give it a day at least, but double posting for the simple reason to bump your topic is not acceptable so soon.   
Logged
Re: ENGINE for getting hurt
« Reply #2 on: August 02, 2009, 03:26:52 pm »
  • Doesn't afraid of anything
  • *
  • Reputation: +42/-0
  • Offline Offline
  • Gender: Male
  • Posts: 7002
I guess what you could do is set a variable to true when he collides with an enemy.  On the step event, if this variable is true, then disable player control and move the player backwards on the appropriate axis.  Use a counter to keep track of how many steps this will take, and on the last step needed, set the variable back to false.
Logged



i love big weenies and i cannot lie
Re: ENGINE for getting hurt
« Reply #3 on: August 02, 2009, 08:39:39 pm »
  • Make your best move ass-bite!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 139
I guess what you could do is set a variable to true when he collides with an enemy.  On the step event, if this variable is true, then disable player control and move the player backwards on the appropriate axis.  Use a counter to keep track of how many steps this will take, and on the last step needed, set the variable back to false.

The new varible idea is not all that great I need like just one, I used this one witch is great but he misses collision with solids and walls

Used in the collide with objLink event: with (other){
{motion_set(point_direction(x,y,other.x,other.y)-180,4)}}
Logged
Re: ENGINE for getting hurt
« Reply #4 on: October 27, 2009, 03:43:35 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 29
Code: [Select]
//This could work maybe...
//This should go in the collision event

if place_meeting( x+1, y, obj_enemy)
   {     x-=(Semi-Big Number)   }
if place_meeting( x-1, y, obj_enemy)
   {     x+=(Semi-Big Number)   }
if place_meeting( x, y+1, obj_enemy)
   {     y-=(Semi-Big Number)   }
if place_meeting( x, y-1, obj_enemy)
   {     y+=(Semi-Big Number)   }


Code: [Select]

//Might have got the (signs messed up a bit, but this might work)
//This should go in the collision event

if self.x > other.x+16
{ x-=(Big Number)
if self.x < other.x-16
{ x+=(Big Number)
if self.y > other.y+16
{ y-=(Big Number)
if self.x > other.y-16
{ y+=(Big Number)


Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.322 seconds with 46 queries.