1. RE: attn: Ray Smith
- Posted by Ray Smith <smithr at ix.net.au> Sep 28, 2003
- 502 views
Steve wrote: > I was just curious if you are still messing with your allegro wrapper. > Been playing around with it lately and just wondered if anything new has > > been done with it. > > Also, you said it *should* work under Linux with a few modifications. > Anything specific to look for if one was to give that a try? Hi Steve, No, I haven't touched euAllegro for a year or so ... and I have no plans to do anything more with it in the future. The only difficulties would be getting everything compiled under Linux. (and possibly changing the open dll routines to look for .so's) Saying that I have always struggled getting c libraries compiled!!! I'd be happy to help where ever I can :) Regards, Ray Smith http://rays-web.com
2. RE: attn: Ray Smith
- Posted by Steve <bleak_outlook at hotmail.com> Sep 29, 2003
- 459 views
Ugh, Forgot about those dll's. C and me aren't all that friendly either. I might give it a run anyways, call it a learning experience. Question: I am having a heck of a time with sprite transparency. The allegro doc said you should set the color to max red and blue and zero green for True color. Using Gimp for windows for my images. Still get hot pink using draw_sprite and mased_blit. Any ideas where I am chewed up here? I have set the mode to 32 bit as well. I'll put the code up here (its pretty short). Thats probably not very coherent, sorry. Just trying to figure out why I am not getting transparency. Thanks, Steve
3. RE: attn: Ray Smith
- Posted by Steve <bleak_outlook at hotmail.com> Sep 29, 2003
- 481 views
Sorry this is a bit long. I removed a few of the unimportant routines to shorten it some. procedure update_screen() blit(back_image, buffer, 1, 1, 1, 1, 1024, 768) if someone_died = 1 then blit(boom_image, buffer, 1, 1, loc_x, loc_y, 100, 100) else masked_blit(ship_image, buffer, 1, 1, loc_x, loc_y, 87, 61) end if if someone_died = 2 then blit(boom_image, buffer, 1, 1, enemy_loc_x, enemy_loc_y, 100, 100) else masked_blit(enemy_image, buffer, 1, 1, enemy_loc_x, enemy_loc_y, 87, 24) end if blit(player_status, buffer, 1, 1, 50, 50, player_life, 20) blit(enemy_status, buffer, 1, 1, 750, 50, enemy_life, 20) blit(buffer, screen_ptr, 1, 1, 1, 1, 1024, 768) end procedure procedure enemy_shoot() -- Enemy shoot routine enemy_shotx = enemy_loc_x + 33 enemy_shoty = enemy_loc_y + 24 update_screen() line(screen_ptr, enemy_shotx, enemy_shoty, (enemy_shotx - 300), enemy_shoty, makecol(200, 0, 0) ) if loc_x >= (enemy_shotx - 300) and enemy_loc_x >= loc_x then if loc_y <= enemy_shoty and (loc_y + 61) >= enemy_shoty then player_life -= 20 if player_life <= 0 then someone_died = 1 update_screen() rest(2000) end if end if end if rest(20) update_screen() end procedure procedure fire_laser() -- Player shoot routine shotx = loc_x + 70 -- these guys are for moving the laser start point to the actual laser gun shoty = loc_y + 53 update_screen() line(screen_ptr, shotx, shoty, (shotx + 300), shoty, 255) if enemy_loc_x <= (shotx + 300) and loc_x <= enemy_loc_x then if enemy_loc_y <= shoty and (enemy_loc_y + 24) >= shoty then enemy_life -= 20 if enemy_life <= 0 then someone_died = 2 update_screen() rest(2000) end if end if end if rest(20) update_screen() end procedure set_color_depth(32) -- set the color depth to 32 bit ret = allegro_init() -- fire up allegro if ret < 0 then -- if allegro is pooched then allegro_exit() -- shut the prog down abort(1) -- tell windoze that end if -- its broke ret = install_keyboard() ret = set_gfx_mode(GFX_AUTODETECT, 1024, 768, 1024, 768) ret = install_timer() ret = install_int(routine_id("increment_counter"), 100) screen_ptr = SCREEN() shipPalette = allocate_palette() set_palette(default_palette() ) buffer = create_bitmap( SCREEN_W(), SCREEN_H() ) back_image = load_tga("background_2.tga", default_palette() ) ship_image = load_tga("soda_cruiser.tga", default_palette() ) enemy_image = load_bitmap("enemy_ship.bmp", default_palette() ) player_status = load_bitmap("player_status.bmp", default_palette() ) enemy_status = load_bitmap("enemy_status.bmp", default_palette() ) boom_image = load_bitmap("boom.bmp", default_palette() ) update_screen() while endflag != 1 and someone_died = 0 do enemy_decision() if key(KEY_UP) then loc_y -= 8 if loc_y < 0 then loc_y = 768 end if update_screen() elsif key(KEY_DOWN) then loc_y += 8 if loc_y > 768 then loc_y = 1 end if update_screen() elsif key(KEY_RIGHT) then loc_x += 8 if loc_x > 1024 then loc_x = 1 end if update_screen() elsif key(KEY_LEFT) then loc_x -= 8 if loc_x < 0 then loc_x = 1024 end if update_screen() elsif key(KEY_SPACE) then fire_laser() elsif key(KEY_ESC) then endflag = 1 end if end while exit_game()
4. RE: attn: Ray Smith
- Posted by Ray Smith <smithr at ix.net.au> Sep 30, 2003
- 476 views
Steve wrote: > > > Sorry this is a bit long. I removed a few of the unimportant routines > to shorten it some. Hi Steve, I didn't do much testing in high colour screen modes so it's possible it doesn't work!!! anyway ... can you email the code and your bitmaps to me and I'll have a look (ray at rays-web.com). Regards, Ray Smith http://rays-web.com
5. RE: attn: Ray Smith
- Posted by Steve <bleak_outlook at hotmail.com> Sep 30, 2003
- 476 views
Lo and behold, I was playing with it this morning and I got it working. For some reason I had a couple of the images saved as .tgas. Well I resaved them as bitmaps and opened them with load_bitmap() instead of load_tga() and now they are transparent where they are supposed to be. Thanks for the patience though :) Steve
6. RE: attn: Ray Smith
- Posted by Ray Smith <smithr at ix.net.au> Sep 30, 2003
- 467 views
Steve wrote: > Lo and behold, I was playing with it this morning and I got it working. > For some reason I had a couple of the images saved as .tgas. Well I > resaved them as bitmaps and opened them with load_bitmap() instead of > load_tga() and now they are transparent where they are supposed to be. Glad you got it working :) Regards, Ray Smith http://rays-web.com