[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4505: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4507: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4508: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4509: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
SloGameDev.net • Poglej temo - [Java] Rotacija slike oz. sprita

[Java] Rotacija slike oz. sprita

Za vse novince v izdelovanju iger.

[Java] Rotacija slike oz. sprita

OdgovorNapisal/-a JanNovak » Ne Jul 22, 2012 11:18 am

Pozdravljeni,

izdelujem svojo 2D igrico in sem naletel na težavo. Trenutno lahko premikam svojega igralca po terenu oz. na panelu z želenimi tipkami, sedaj bi pa hotel da bi se obrnil v smeri miškinega kazalca, vendar je težava v tem, da ga ne znam niti obrniti za nekaj stopinj kaj šele, da bi gledal v smeri kazalca. Nekaj sem se igral z "AffineTransform", vendar mi ni uspelo. Ve kdo kako bi rešil ta problem? :?

Lep pozdrav
Jan Novak
www.androidek.si <- Moja android aplikacija :D
Uporabniški avatar
JanNovak
novinec
novinec
 
Prispevkov: 6
Pridružen: Ne Apr 29, 2012 3:41 pm
Kraj: Ljubljana

Re: [Java] Rotacija slike oz. sprita

OdgovorNapisal/-a Retro » Ne Jul 22, 2012 1:07 pm

Seveda ti znamo pomagati, bos pa moral povedati malce vec, predvsem s cim delas svojo igro. AffineTransform ... kaj je to, html5+css3+javascript? Flash? Kaj drugega?

Lahko prilepis tudi kodo, ki jo trenutno uporabljas za izris igralca, da ti lazje pomagamo.
//
Uporabniški avatar
Retro
SGD Admin
SGD Admin
 
Prispevkov: 1008
Pridružen: Če Sep 04, 2003 10:14 pm
Kraj: ZX Spectrum 48k+

Re: [Java] Rotacija slike oz. sprita

OdgovorNapisal/-a JanNovak » Ne Jul 22, 2012 3:40 pm

www.androidek.si <- Moja android aplikacija :D
Uporabniški avatar
JanNovak
novinec
novinec
 
Prispevkov: 6
Pridružen: Ne Apr 29, 2012 3:41 pm
Kraj: Ljubljana

Re: [Java] Rotacija slike oz. sprita

OdgovorNapisal/-a Grandy » Po Jul 23, 2012 8:48 am

Kot se zracuna po naslednjem principu: najprej zracunas razdaljo med kurzorjem in igralcem po x in y osi (dx = mx - ix, dy = my - iy) . Kot zracunas z Math.atan(dy/dx), samo je treba mal prilagodit za vse stiri kvadrante. Mal pobrskej po netu, kode na to temo je cel kup.
Grandy
wannabe
wannabe
 
Prispevkov: 118
Pridružen: Po Sep 22, 2003 9:29 am

Re: [Java] Rotacija slike oz. sprita

OdgovorNapisal/-a Retro » Po Jul 23, 2012 8:33 pm

//
Uporabniški avatar
Retro
SGD Admin
SGD Admin
 
Prispevkov: 1008
Pridružen: Če Sep 04, 2003 10:14 pm
Kraj: ZX Spectrum 48k+

Re: [Java] Rotacija slike oz. sprita

OdgovorNapisal/-a JanNovak » So Jul 28, 2012 4:19 pm

Hvala Vam za odgovore. Razmišljal sem,da bi naredil celozaslonsko igro. To, da bo igra prikazana celozaslonsko nebi smelo biti težav, vendar kako je z grafiko? Oziroma kako so sploh celozaslonske 2D igre zasnovane? Za vsako resolucijo menda niso narejene posebej slike ustreznih velikost ali pač? Pomislil sem na to, da so narejene na najvišji ločljivosti potem pa se jih pomanjša na zaslonsko resolucijo uporabnika? Samo če pomanjšaš v nekem razmerju moraš praznini okoli napolniti in to ni videti preveč lepo, saj želim,da bi bila igra videti vsepovsod isto. Ali je kakšna druga rešitev? Ima kdo izkušnje s tem in bi mi lahko svetoval kaj je najboljša rešitev. .<(5)>
www.androidek.si <- Moja android aplikacija :D
Uporabniški avatar
JanNovak
novinec
novinec
 
Prispevkov: 6
Pridružen: Ne Apr 29, 2012 3:41 pm
Kraj: Ljubljana

Re: [Java] Rotacija slike oz. sprita

OdgovorNapisal/-a Retro » So Avg 04, 2012 12:25 am

Ko gres v polnozaslonski nacin ponavadi dolocis tudi v katero resolucijo gres. Torej ni nujno, ce imas monitor 1440x900, da gres v fullscreen s to velikostjo. Lahko gres tudi v 800x600 in ponavadi ze sam gonilnik doda crne robove pri strani/na vrhu.

Po drugi strani lahko v dolocenih primerih, recimo za igre, kjer je svet igre vecji kot za en ekran, enostavno na vecji resoluciji izrises vec sveta (za primer side-scrollerji/platforme ali pa top-down shooterji/dirkanje).

Ni najboljse resitve - glavno je kaj ti hoces dosezt, oziroma vsak primer ima svojo resitev. Verjetno je zate najboljsa hkrati najbolj enostavna, da se kar omejis na neko fiksno velikost in vse zasnujes okoli tega. Konec koncev tudi flash igre velikokrat delajo znotraj takih okvirov.
//
Uporabniški avatar
Retro
SGD Admin
SGD Admin
 
Prispevkov: 1008
Pridružen: Če Sep 04, 2003 10:14 pm
Kraj: ZX Spectrum 48k+


Vrni se na Začetniki

Kdo je na strani

Po forumu brska: 0 registriranih uporabnikov in 1 gost

cron