New to GDevelop…
Just about finished my 1st game: a “Flappy Bird” game.
The event sheet on the playing scene to almost 3 pages long(1080p).
This is a very simple game so I must be doing some things wrong?
Can someone look at the event sheet and propose optimizations to its length?
Use subevents. You have a lot of events that check if the GameOver variable is false. If you have one event with this condition, you can make the subevents of the other events that check on the GameOver variable.
Same goes for events when GameOver is true.
You can do away with the variables Brick_Wall_Top_And_Bottoms… as you only reference them once. Instead, replace the variable in the condition with the calculation.
In these events below, you are using physics behaviour but manually modifying the object’s position and rotation. This is not a good idea as it can lead to the game behaving in an unwanted manner:
The same goes for the wall objects that have physics behaviour. You could move using GDevelop forces or move the walls using physics instead, giving the movable walls 0 friction and gravity
Additionally, the 3rd and 4th events in the above screen snip do the same thing; you can reduce this with to event and combine the LMB/spacebar press in an OR condition.
I feel that keeping an object within bounds is a good reason to change the position directly. The physics engine isn’t bulletproof, it is made for performance rather than perfection, and so you can sometimes get objects into “impossible” positions which then need to be corrected. Leading to, for example, objects going through walls.
The angle thing does look a bit more dubious but not that dangerous. Directly setting velocity on the other hand is actually part of the Physics2 behavior and is the only way to move Kinematic objects.
OK, in this case I would use the usual Force/Impulse actions. I’m not sure what else is wrong with this though?