Help with some game polish
quantumsheep
Member Posts: 8,188
Hey all,
Was wondering if I could ask for a few ideas.
I'm working on a 2.5D game called 'Sol' - it's a space shooter. Take a look:
http://quantumsheep.googlepages.com/sol-help.jpg
Please excuse the Tie Fighters - they're easy to draw and strictly placeholder!
Everything's working pretty well, and I'm quite happy with it. However, there are a couple of things I'd like to polish:
Shooting:
Currently, if the mouse position is over an enemy and you click the left mouse button, the enemy explodes. Lovely! But you don't see any laser fire.
Ideally, I'd like two lasers to shoot from two positions, one above where it says 'score', the other above 'shields'.
The lasers should meet at the point the cursor was *at*, as the cursor could move. So simply making something go towards the cursor wouldn't work (unless it lasted less than a second for example, but I'm thinking there's room for bugs down that route...)
I was speaking to a friend of mine, and his solution seemed really complicated and involved lots of maths, which I'm useless at. Anyone here got any thoughts on how to accomplish this?
Secondly...
Screen shake:
As you can see, there's a cockpit at the bottom of the screen, which I rather like. How can I make it shake (or the whole screen shake?). I think it'd add an important bit of feedback to the player if he's hit by an enemy missile, but can't work out how to accomplish this.
Any help would be greatly appreciated!
And now, to bed!
Thanks in advance!
QS
Was wondering if I could ask for a few ideas.
I'm working on a 2.5D game called 'Sol' - it's a space shooter. Take a look:
http://quantumsheep.googlepages.com/sol-help.jpg
Please excuse the Tie Fighters - they're easy to draw and strictly placeholder!
Everything's working pretty well, and I'm quite happy with it. However, there are a couple of things I'd like to polish:
Shooting:
Currently, if the mouse position is over an enemy and you click the left mouse button, the enemy explodes. Lovely! But you don't see any laser fire.
Ideally, I'd like two lasers to shoot from two positions, one above where it says 'score', the other above 'shields'.
The lasers should meet at the point the cursor was *at*, as the cursor could move. So simply making something go towards the cursor wouldn't work (unless it lasted less than a second for example, but I'm thinking there's room for bugs down that route...)
I was speaking to a friend of mine, and his solution seemed really complicated and involved lots of maths, which I'm useless at. Anyone here got any thoughts on how to accomplish this?
Secondly...
Screen shake:
As you can see, there's a cockpit at the bottom of the screen, which I rather like. How can I make it shake (or the whole screen shake?). I think it'd add an important bit of feedback to the player if he's hit by an enemy missile, but can't work out how to accomplish this.
Any help would be greatly appreciated!
And now, to bed!
Thanks in advance!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Comments
Secondly, I would also like to know how to hit an enemy based on where the enemy "was". This would be important for my TD game. On a side note Quantum, you may have already thought of this, but on the wiki it shows you how to scale based on distance. Are you going to make it so the lasers get smaller the further away they get? That'd be awesome. Game looks nice so far. Neat concept for an iPhone game.
http://gamesalad.com/wiki/how_to_gsc_position_based_scaling
Cheers for the link though - I don't get it right away (maths+equations=cryingsheep) but I'll dig in when I have a few hours free ahead of me...
Cheers,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
the laser thing i have no idea atm of how to work on, but im sure the gs team will be able to help out.
about the cockpit shacking, you could make a rule inside the cockpit actor for it to move right-left up-down really fast every time you shoot. just make sure at the end of the "shake" that the cockpit goes back to the original spot.
So you could create laser gun actors that Rotate To Position, and they would do the Spawn Behavior of the laser projectile.
As for separate actors for the laser guns, I would use the examples shown in the wiki how-to. But add an offset to position your guns in the right place. More calculations would be needed if you are rotating the ship, but the example should help a lot if your ship always faces the same direction.
http://gamesalad.com/wiki/how_to_gsc_follow_another_actor
Nulo: I tried that idea for cockpit shaking yesterday when I was tired, and it didn't work. It *may* have been my brain deciding it didn't want to work, so I'll give it another go!
Codemonkey: That's very useful and I'll certainly look into it. However, the lasers are purely cosmetic - when you press the mouse button, anything under the mouse is destroyed instantly. Therefore I need a laser to insantly travel to that point. I'll experiment though - your way of thinking (rotating guns) was similar to what I had in mind, you just made it clearer for me in my head, so thanks for that!
Onwards!
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
1. Position your Actor and take note of the current X and Y coordinates.
2. Create two integer Actor Attributes: OriginalX, OriginalY, and one real Game Attribute: ShakeAmount.
3. Add Actor Behavor: Change Attributes OriginalX and OriginalY to the original X and Y positions.
4. Add Actor Rule:
`
- if Game.ShakeAmount>0
-- Create Timer for every 0.1 seconds
---- Change Attribute: Game.ShakeAmount=Game.ShakeAmount-0.5.
---- Constrain Attribute: Actor.Position.X=Actor.OriginalX+random(Game.ShakeAmount*-1,Game.ShakeAmount)
---- Constrain Attribute: Actor.Position.Y=Actor.OriginalY+random(Game.ShakeAmount*-1,Game.ShakeAmount)
`
5. Now, in another actor that detects whenever you get hit, add 5 to the Game.ShakeAmount, but don't make it exceed 10 (`if Game.ShakeAmount>10 Change Attribute: Game.ShakeAmount=10`) or it'll look too crazy. Also, don't just reset the Game.ShakeAmount to 5, add to it - it'll be like two consecutive hits will look quite painful.
What it will do is shake the actor violently, then trickle off back to the original position, i.e. if the current Game.ShakeAmount is 5, it will reposition the Actor anywhere -/+ 5 of its original X and Y positions, then it will be only 4.5 pixels away from the original spot, then 4, then 3.5, and so on until it hits 0, going back to its original spot.
I'm only guessing with the numbers, so play around with it to your taste and liking.
Watch my Torque 2D game, Archangel, and check out the screen shakes I did there: http://tinyurl.com/archvideo
Let me know if this helps out.
when you touch somewhere, spawn the lazer, and then in the lazer set destinationX to game.Touch.X and same thing for Y
then in your move to rule, send it to the local attributes
that's what I did in V is for Vortex to make the portal bullets go whereever you touch.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
http://gamesalad.com/game/play/31279
It shows how to draw two lines of any length between two points anywhere on the screen.
You would simply lock one of the points to shield word and the other to the cursor. Same thing for the score word...
I can help out better when I'm back at my computer...
In other game engines, the screen shake method I used was actually applied to the Camera View, which made everything shake. Since I'm not in front of GS right now, I don't know if the Camera can actually be manipulated, but if it can (or will in a future GS update), this would be the place to put it.
This has certainly sparked my interest again in one of my first games - I think I could make something really awesome out of it now if I tried:)
Was wondering, if you guys get a chance, if you had any thoughts on how I'd implement some controls on a different game. I'll give it a go myself first though before I come running for help!
Now, if you'll excuse me, I have to get back to 'Unbearably Wonderful - The Morning After Edition'
(joke!)
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io