Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
EDIT: (May I also suggest using a variable as a timer? I.E. :
You can add me if you want more help or something
You've created the timing variable in the create event, but I'm using a script to run my movements for my enemies. Here's how it's layed out:
I have 26 enemies, in the Step Event I have excute script > scr_enemy_movement
Inside that script I have a switch statement that calls another script so
switch(object_index)
{
case(obj_enemya):
scr_zigzag();
break;
case(obj_enemyb):
scr_attack();
break;
}
This way all the movements are right there in one file. My question is can I still put the timing variable in the custom script (like scr_zigzag), and not in the create event? (I'm still learning about how these customvariable/global variables interact with the objects).
My next question is about move again. If I'm using the D&D move_fixed, it has a direction pad so I can, for example, click all four directions and create an alarm to run it again and the enemy will choose and move in one of those four direction each time the alarm triggers. BUT, it's just motion_set(direction, speed)! Where's the code for the choose a direction from the 4 provided?
For the second question, there isn't a function that only does the cardinal directions, but you can make another script (or just extend the code, but script would be better/simpler) that "rolls a 4 sided die" and picks one of 4 directions (90 degrees, 180 deg. etc). You could then replace all the motion_set(random(360),2) in your code/scripts with the new script.
Okay I realised that in this case, you can do an extremely simple "irandom(3)*90" as the direction so:
(I forgot to use [code] formatting in my last post)
EDIT: I forgot to times the random integer by 90
Three more questions, if you're up for it!
I've got an object that when Left Pressed Event runs code
instance_change(obj_touchpurp,0); //Changes the object into a colorful explosion
And in the obj_touchpurp
Step Event
image_blend = make_colour_hsv(random(254),255,255); //Here I'm trying to change the hue to be a random color so the playing sprite will be different for each enemy clicked
image_speed = .75; //plays animation a little slower
image_xscale += .03; //slowly increases size
image_yscale += .03; //slowly increases size
Animation End Event
instance_destroy();
My two questions are:
1. If I set the make_color_hsv Saturation and Value to 255, does that mean it will not change? (I only want to hue value to vary, and the sat and val to not change)
2. In the step event means that image_blend is running all the time, and I get a psychedelic trip. I want it to pick a new hue, play the animation, and destroy. I can't put it in a create event because it's already created! *edit I figured out that instance_change allows me to change the preferences so that it will include a create, so I tossed the image_blend code in there and it seems to work, but I think the saturations and value are messed up.
Lastly, is there a way to make the enemies not stack on each other when they're following the player? I know of mp_potential_step(obj_player.x,obj_player.y,1,0); but just when they're wandering or doing their thing. (Maybe this is what I use? I don't know!)
I'm also going to be working on my player AI; I really want my player to automatically avoid the enemies. This means that I'll use the mp_potential_step, but set the speed to negative. The downside is that the player isn't that smart and lots of times ends up in the corner trapped!
I still dont' know how to not make them stack though, but I guess I can live with it for now.