• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Question about designing

1) I wanted to make glow and tried to use new layer behind my object's layer and reduce it's transparency, but :
a) if object have an animation (24 frame for example) a new layer will be added to all 24 frames at once (what the hell ?)
b) by changing the properties of a layer on one frame, you automatically change the property of the same layer on all other frames
(If you don't use GMs the drawing environment, what do you recommend ?)

2) I want to see line between my spaceship and the object in the direction of which the ship itself is directed.
I tried draw event and it was redrawing my ship, drawing a line instead. I tried GUI - it worked lil better, but still sucked (it moved with the camera, so if my spaceship stayed at 1 place and could disappear from the field of view of the game, then the line coming from this ship was always in the camera
Is it really only necessary to create a new object, just to indicate the line between one object and another ?)

3) I also want that when an object flies past another object, there is a reflection of light, is it possible to do this somehow not through an additional object?
There is an idea to change the sprite when approaching, but I'm afraid that it will work clumsily, because the object moves freely and there should be different reflections at different angles
 
Last edited:

Roldy

Member
1) I wanted to make glow and tried to use new layer behind my object's layer and reduce it's transparency, but :
a) if object have an animation (24 frame for example) a new layer will be added to all 24 frames at once (what the hell ?)
b) by changing the properties of a layer on one frame, you automatically change the property of the same layer on all other frames
(If you don't use GMs the drawing environment, what do you recommend ?)

2) I want to see line between my spaceship and the object in the direction of which the ship itself is directed.
I tried draw event and it was redrawing my ship, drawing a line instead. I tried GUI - it worked lil better, but still sucked (it moved with the camera, so if my spaceship stayed at 1 place and could disappear from the field of view of the game, then the line coming from this ship was always in the camera
Is it really only necessary to create a new object, just to indicate the line between one object and another ?)

For #1 you will need to show your implementation to get help.

For #2 you can use your spaceships draw event. Do something like:

GML:
draw_line(x, y, _x2, _y2);     // Draw a line under your ship sprite

draw_self();                  // Draw your ship sprite

draw_line(x, y, _x2, _y2);  // Draw a line on top of your ship sprite
Manual page for draw_self
 
GML:
Code:
draw_line(x, y, _x2, _y2);     // Draw a line under your ship sprite

draw_self();                  // Draw your ship sprite

draw_line(x, y, _x2, _y2);  // Draw a line on top of your ship sprite
it worked, thanks
but is everything okay with this line ?
 

Attachments

Roldy

Member
I can record a video if it would help
No. Code helps. A video would probably leave people guessing at what is going on.

but is everything okay with this line ?
I don't know. Do you want it to look the way it does? Then it is ok. If it doesn't look like you want it to... then it is not ok. Show the code and describe what you want and someone might be able to help you.

There are lots of drawing functions. Including draw_line_width.

Read through the manual. Get familiar with how things work and the available functions. I promise it will be worth your time.
 
I don't know. Do you want it to look the way it does? Then it is ok. If it doesn't look like you want it to... then it is not ok. Show the code and describe what you want and someone might be able to help you.

There are lots of drawing functions. Including draw_line_width.

Read through the manual. Get familiar with how things work and the available functions. I promise it will be worth your time.
to be honest i want to see a whole line without breaks and this line looks wierd
 
What do you mean by glow animation? Also, the sprite editor for GMS is very limited in terms of effects, you're much better off drawing the sprite in a different piece of software to get a glow effect. You can compile Aseprite yourself for free (slightly technical), or just download GIMP (much less technical), both of those free pieces of software have options to add a glow style effect to a pixel-art image.

A simple draw_line(x1,y1,x2,y2) will not have those line breaks you are showing. Are you scaling your view at all? Usually those sort of artifacts are due to scaling, with the GPU having to guess which pixels to include and which to not when there are more pixels than "space" to draw them.
 
Is your monitor's resolution 1920x1200? Or is 1920x1080? If it's actually 1920x1080 then that explains why the line is drawn wrong: You are trying to draw 1200 pixels on 1080 pixels, so the GPU decides to cut some of them out, leading to gaps in the line. If that is the case, then the fix is to change your camera and viewport settings to 1200 x 1080 instead of 1200 x 1200.
 
Is your monitor's resolution 1920x1200? Or is 1920x1080? If it's actually 1920x1080 then that explains why the line is drawn wrong: You are trying to draw 1200 pixels on 1080 pixels, so the GPU decides to cut some of them out, leading to gaps in the line. If that is the case, then the fix is to change your camera and viewport settings to 1200 x 1080 instead of 1200 x 1200.
Oops, thank you
 
For #2 you can use your spaceships draw event. Do something like:

GML:
draw_line(x, y, _x2, _y2);     // Draw a line under your ship sprite

draw_self();                  // Draw your ship sprite

draw_line(x, y, _x2, _y2);  // Draw a line on top of your ship sprite
why you draw a line before and a line after the draw_self?
one of the would not suffice?
 
For #1 you will need to show your implementation to get help.

For #2 you can use your spaceships draw event. Do something like:

GML:
draw_line(x, y, _x2, _y2);     // Draw a line under your ship sprite

draw_self();                  // Draw your ship sprite

draw_line(x, y, _x2, _y2);  // Draw a line on top of your ship sprite
Manual page for draw_self
Do you have any ideas about #3 ?
If it is impossible for Game Maker - it will be okay
 

Roldy

Member
Do you have any ideas about #3 ?
If it is impossible for Game Maker - it will be okay
If I understand what you are saying, that you want some sort of shading or reflection on your ship based on positional light sources / explosions / laser beams / whatever... that is totally possible. And it could be achieved in a number of different ways, probably the most straight forward would be a shader and having a simple normal map for your ship. But there could be lots of ways to achieve this.

Here is a blog post from YoYo about normal maps in 2d games: https://www.yoyogames.com/en/blog/using-normal-maps-to-light-your-2d-game

Here is a slightly older video for GMS2, but it probably has relevant info:
 
Top