In the game I'm working on (TDS), I'm having problems with the enemies shooting at the player. When the enemies shoot an instance of the bullet object is created at the enemy's x,y location which ends up blowing up the enemy in question. So, I'm wondering how I can create the bullet instance just in front of the enemy when the enemy can be facing any direction.
Any help appreciated!
- Game Maker Community
- → Viewing Profile: Topics: LMB
LMB
Member Since 17 Sep 2011Offline Last Active Nov 09 2011 08:03 PM
Community Stats
- Group New Member
- Active Posts 49
- Profile Views 911
- Member Title GMC Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
Topics I've Started
Finding a location just in front of object
10 October 2011 - 01:27 AM
One way barriers?
07 October 2011 - 03:49 AM
Sorry to post 2 questions in a row, they are completely different issues though.
In the game I'm working on there are bases that spawn enemies. The problem occurs when a spawned enemy finds it's way back into the base. I'd like to put some kind of object across the opening to the base that lets enemies out, but not back in.
Does anyone know of a tutorial or some example code that would show how this can be done?
Thanks!
In the game I'm working on there are bases that spawn enemies. The problem occurs when a spawned enemy finds it's way back into the base. I'd like to put some kind of object across the opening to the base that lets enemies out, but not back in.
Does anyone know of a tutorial or some example code that would show how this can be done?
Thanks!
Identifying Rooms
07 October 2011 - 03:18 AM
I've searched the FAQ and documentation but I've not found an answer to this question.
Is there a way to determine which room you're in?
For example, I'd like to have decisions made about how many enemies to spawn based on how far the player has progressed in the game.
Any help appreciated.
Is there a way to determine which room you're in?
For example, I'd like to have decisions made about how many enemies to spawn based on how far the player has progressed in the game.
Any help appreciated.
Function that tells if value is in a range?
06 October 2011 - 10:52 PM
I've been searching the documentation and doing searches here but haven't found an answer, so...
Is there a function that will return true if a value is within a range, false if it's not?
Something like: range_check(begin_val, end_val, val_to_check);
So then you could do something like:
Or am I going to have to write my own script to handle this?
Any help appreciated!
Is there a function that will return true if a value is within a range, false if it's not?
Something like: range_check(begin_val, end_val, val_to_check);
So then you could do something like:
if(range_check(obj_someobj.x -50, obj_someobj.x + 50, obj_otherobj.x)
{
// Do something...
}
Or am I going to have to write my own script to handle this?
Any help appreciated!
Keeping enemies from getting tangled up
03 October 2011 - 04:44 PM
In the game I'm working on enemies pursuing the player will in time get very close to each other and eventually touch. What I've done in the past was make enemies solid and have a collision event. No code was necessary in the collision event, just having it kept the enemies from overlapping each other.
In this game when the enemies touch they sometimes get tangled up with each other so that both are stuck and just sit there twitching.
Hoping to aid them in becoming unstuck I added the following code to the collision event:
This seems to have only irritated them because now they twitch more violently.
Does anyone have any ideas for a better code that could help them separate from each other?
Edit: I'm using GM 8.1 Lite, in case that's important.
In this game when the enemies touch they sometimes get tangled up with each other so that both are stuck and just sit there twitching.
Hoping to aid them in becoming unstuck I added the following code to the collision event:
motion_set(choose(direction-90, direction+90),move_speed);
This seems to have only irritated them because now they twitch more violently.
Does anyone have any ideas for a better code that could help them separate from each other?
Edit: I'm using GM 8.1 Lite, in case that's important.
- Game Maker Community
- → Viewing Profile: Topics: LMB
- Privacy Policy
- GMC Rules and Forum Rules ·



Find content