1 registered members (AndrewAMD),
1,213
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: how can make screen moving on 2d game?
[Re: MDI]
#166398
11/09/07 12:17
11/09/07 12:17
|
Joined: Apr 2002
Posts: 4,801 Richmond B.C., Canada
Captain_Kiyaku
Dichotomic
|
Dichotomic
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
|
you can create an array for your 100 panels, and save the pointers in it and let them move in a while loop when you go with your mouse to the edge of your screen.
would be like this:
panel* ptrPanelTemp; function fncMoveScreen(iX, iY) { while(iCounter < 100) { ptrPanelTemp = ptr_for_handle(yourArray[iCounter]); ptrPanelTemp.pos_x += iX; ptrPanelTemp.pos_y += iY; iCounter += 1; } }
and call it like fncMoveScreen(5, -7);, depends on how you want to move the screen
this should work when you saved all the pointers in this arrays at the beginning of your game.
My Blog"Tag und Nacht schrei ich mich heiser, Wind weht alle Worte fort, Tag und Nacht schrei ich mein Krähenwort!"Subway To Sally - Krähenkönig
|
|
|
how can make screen moving on 2d game?
[Re: ISG]
#166400
11/11/07 20:03
11/11/07 20:03
|
Joined: Sep 2006
Posts: 188 Latvia
MDI
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 188
Latvia
|
Sorry but i somehow dont understand that in ptr_for_handle(yourArray[iCounter]);
I need create panel and then store it with handle under yourarray, but what is that icounter?
Latvija rullē
|
|
|
Thanks for help
[Re: MDI]
#166401
11/12/07 23:45
11/12/07 23:45
|
Joined: Sep 2006
Posts: 188 Latvia
MDI
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 188
Latvia
|
With your ideas i done some fixes and now game works really nice.
Latvija rullē
|
|
|
Re: Thanks for help
[Re: Captain_Kiyaku]
#166403
11/13/07 18:02
11/13/07 18:02
|
Joined: Sep 2006
Posts: 188 Latvia
MDI
OP
Member
|
OP
Member
Joined: Sep 2006
Posts: 188
Latvia
|
Aha! I there dont find way how put in that array without errors. And then i transform panels in sprites and move camera in 3d world. With all of this now is easy to make events and other stuffs.
Only sprites strangly reacts on event_touch and event_release - dont wait till release but already after frame make event-rel.. and then again event_tou.. and continue so long till i move mouse off from sprite. That is normal or engine bug with sprites?
P.S. my fault!! HEHE! That happens when on model creates new sprite(checkbox) Now need do something to ignore him.
Last edited by MDI; 11/13/07 19:34.
Latvija rullē
|
|
|
|