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.

AppGameKit Classic Chat / set sprite size

Author
Message
3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 19th Apr 2013 20:57
The physics stops when i scale my sprite in a loop.

i have dynamic sprite

agk::SetSpriteSize(sprite,xsize,ysize);

When I update it the program freezes using

agk::Update(time);

Does any one know how to update a sprite size and not freeze the screen.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 19th Apr 2013 21:09
Are you changing the sprite size every loop?

A sample of the code you use might help.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 19th Apr 2013 22:44 Edited at: 19th Apr 2013 22:47

the commented code is what is not working

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 19th Apr 2013 23:43
I think the problem is that, when you change the size of the sprite, the physics size and stuff change.

So, you should turn the physics on the sprite off before resizing it and the reset it to what you originally wanted it to be.

And remove the agk::Update call. That is unnecessary since it will all update at the next sync cycle.

How often do you call RSPRITE:ISPLAYSPRITES2?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 20th Apr 2013 17:57
i call it every loop I might just leave scaling physics out of my program for know. Tell I get the rest of the program done. That will take a while. I still need to debug a-lot of stuff in my sprite engine so this is not a major issue.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 20th Apr 2013 18:05
Have you tried to just redo the collision shape after altering the sprite's size?

Login to post a reply

Server time is: 2024-11-24 12:04:54
Your offset time is: 2024-11-24 12:04:54