Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 20:05
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TedMar, VoroneTZ), 1,317 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Walking in 2d game #283450
08/07/09 20:13
08/07/09 20:13
Joined: Jul 2009
Posts: 19
Poland
V
Varen Offline OP
Newbie
Varen  Offline OP
Newbie
V

Joined: Jul 2009
Posts: 19
Poland
Hey, im making 2d multiplayer game and i have some questions for u, masters of programming ^^:
1) how should i make an animated character walking to a target on the map by clicking with the mouse? It should have different animations for walking right, left, up and down. It should be animated standing as well, kinda animation of breathing:

2) how should the map be created, as panel? And how to make character stick to the center of the screen (i mean when he is walking, the world "moves")? The character can go to every direction

I know there are many tutorials but most of them are about 3d games and animation of models, not 2d characters

Re: Walking in 2d game [Re: Varen] #283600
08/08/09 18:13
08/08/09 18:13
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
I am not sure if it's the best to start with mp, because it's pretty complicated and with panels you can't use the helper functions gs offers you to make it easier.

Imo it would be the best, if you create for a player entity a struct, which holds all information like position, health, name, etc. and a pointer to a panel.

for the animation of the character you should look into the window element of panels.

the tricky part about 2d games is, that you have to code your own 'camera'. All you need is a vector, that stores the cams positions (top left corner works always fine) and for every element in a scene a vector that stores its absolute (=world) coordinates.
If you now as example move the camera 10px to the right, everything on screen is getting shifted 10px to the left. so to get the screen position of the panels, you have to take their world coordinates and subtract the cameras position.

I hope I could clear things up a little bit
Scorpion


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1