Help with some game polish

quantumsheepquantumsheep Member Posts: 8,188
edited November -1 in Working with GS (Mac)
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

Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io

Comments

  • JGary321JGary321 Member Posts: 1,246
    First, off I'm clueless to both of your questions =)
    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
  • quantumsheepquantumsheep Member Posts: 8,188
    Heh, yeah, it's something I'll have to experiment with! If I work any of these out, I'll post 'em here!

    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

  • butterbeanbutterbean Member Posts: 4,315
    Let us know when you've figured it out! That would be a great tutorial to add to the Wiki for shooters! :)
  • nulonulo Member Posts: 315
    hey there quantum.
    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.
  • JGary321JGary321 Member Posts: 1,246
    awesome idea nulo. maybe i can use that in the future on a game.
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Think of how a laser gun works. On a ship it would need to rotate to direct the gun instead of the ship to fire it in the right direction.
    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
  • quantumsheepquantumsheep Member Posts: 8,188
    Some great suggestions there, thanks everyone!

    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

  • BeyondtheTechBeyondtheTech Member Posts: 809
    I believe have the answer for screen shaking. I've done it in a few games, and it's rather neat concept (I thank my older brother for the idea). Here's the easy GameSalad translation.

    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.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    this may have been answered above, but I gotta run to catch a train. to make the lazers go to the previous point, on the lazer itself create two attributes - destinationX and destinationY.

    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.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    I am in mid-commute as well, but if you look at my magnitude demo here:

    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...
  • BeyondtheTechBeyondtheTech Member Posts: 809
    Heck ya, I'm getting out of here too. Looking forward to a 3-day weekend with my wife, my kids, and my GameSalad. ;)

    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.
  • JGary321JGary321 Member Posts: 1,246
    Wow, ya'll pulled up an OLD thread. This was back when me & Quantum were still NOOBS with all caps! But anyways, you can have one actor control the camera.
  • ktfrightktfright Member Posts: 964
    those were the days...:)
  • JGary321JGary321 Member Posts: 1,246
    yea... maybe we should bring back "Sous Chefs"... I kinda liked those days... FEEL THE POWER!
  • quantumsheepquantumsheep Member Posts: 8,188
    And I'm *still* a noob! Especially when it comes to the old Math. I guess my brain just doesn't work that way, but I'm glad other people's do, and so thanks to Fire and BTT (and others of course) for their Math magic! :)

    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

Sign In or Register to comment.