Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Can i "scale" the physics engine to use bigger "pixels"

Author
Message
KristianXD1
8
Years of Service
User Offline
Joined: 15th Jul 2016
Location:
Posted: 1st Oct 2016 13:49
I'm working on a test game with pixelart graphics.
i scale up all sprites to 4 times their original size, is there any way to "scale" the physics to follow the scaled pixel grid, or will that require a customized system?

i can't post any code because i haven't written any as i'm struggling a bit with this problem.
JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 2nd Oct 2016 09:37
I'm not sure what you're asking. The built in physics engine doesn't care what your graphics look like. If you're building a game that has a low rez - pixel art style, don't use the scale commands, make sure you still use the size commands to set the sizes of your sprites. This won't effect the physics system at all. If you need to adjust any aspect of the physics system, all physics variables can be adjusted, including physics object's 'weight', the gravity, etc..

If you haven't applied any code yet, than how do you know if anything will go wrong? I say make a test program, throw together a very simple level, throw in some characters and objects and just add the default physics and see what happens. Than just work from there. If you run into any troubles or feel like the physics don't represent the 'scale' of the objects, come back and post the code and I'm sure the community will be happy to help you out.
Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 2nd Oct 2016 11:23
Depending on the style of game, you may find the default physics scale a bit sluggish. I always adjust the physics scale (SetPhysicsScale ()) to 0.05 (the default is 0.20), as this gives me a wider range to play with... Horses for courses
Using AppGameKit V2 Tier 1
KristianXD1
8
Years of Service
User Offline
Joined: 15th Jul 2016
Location:
Posted: 2nd Oct 2016 15:02
ok, i'm gonna try to make some progress later today, if i run into any problems i'll probably come back with a new set of questions

Login to post a reply

Server time is: 2024-11-22 03:07:26
Your offset time is: 2024-11-22 03:07:26