Side-scrolling send troop kind of game template
Twayne2
Member Posts: 458
Anyone got one? I mean, before I maybe start to make a game like this myself.
Comments
Hi Twayne
I can't find the file I used but it was posted by socks somewhere with an idea inspired by ?was it Tatiang?
You can try this format
Game attributes
Actor 1 - "parent actor" or the main thing that scrolls around
Constrain attribute: game.gameX to self.positionX
Constrain attribute: game.gameY to self.positionY
Constrain attribute: game.gameR to self.rotation
RULE
When touch is pressed
Change attribute: set game.OffsetY to game.mousepositionY-self.positionY
Constrain self.positionY to min(400,max(200,game.mousepositionY-game.OffsetY))
--> 400 and 200 are the limits of your scrolling so it doesn't overscroll
Actor 2 - or as many as you want - these are the clickable windows inside your scrollbar
Actor attributes
Change attribute: self.mag to magnitude(game.gameX-self.positionX,game.gameY-self.positionY)
Change attribute: self.angle to vectorToAngle(self.positionX-game.gameX,self.positionY-game.gameY)
Constrain attribute: self.positionY to self.mag*sin(self.angle+game.gameR)+game.gameY
===
This should allow it to scroll up and down
Haven't tested it myself but I'm assuming if you change the appropriate 'Y's to 'X's you can move it sideways instead
Thanks, but that was not my question. My question was if anyone had made a template for that kind of game.
Yes there are a few... So its definitely possible.
I wish but no, it wasn't me.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@amurfted Can you tell me where?