Skip to main content
GameDev.net gamedev.net
🔒 Locked

Animated tilemap problem

Started by Carolina Jul 31, 2006 at 1:25 PM 0 replies 800+ views
Original Post
Carolina
Carolina
Hi there! I´m coding a simple 2D graphics engine for my game and need some help. I have a TileMap class that handles everything related to the creation and animation of a tilemap. It is composed of Tile objects, and an animated tile is just a tile that changes its picture X times per second, like on a water animaton for instance. The thing is, the animated tilemap does work. However, it uses SDL_GetTicks() to know when to change one frame to another, and this simply stops all other graphic and key pressing events from happening (for there is only one thread that SDL uses,right?). The result is horrible but I don´t know what to do. So,any ideas?=/ Thanks, Carol
kadaf
kadaf
Do you do something like this:

...if(SDL_GetTicks() > next_frame_update) {  update_frame();  next_frame_update = SDL_GetTicks() + frame_interval;}...


?

If you do it that way, it's quite strange if it blocks everything else...
-- Rasmus Neckelmann

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.