Permalink
Browse files

fixed throwing-error and added alpha-support for sprites

  • Loading branch information...
1 parent 79a4617 commit 978f58a40b71a3f3a57cc96c959734b2173afe94 unknown committed Apr 25, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 init.rkt
  2. BIN snowball.png
  3. BIN testbild.png
View
6 init.rkt
@@ -46,7 +46,7 @@
;---------------actions----------------------
(define/public (hit!) (if (> hp 0) (set! hp (- hp 1)) (display "Error already dead!")))
(define/public (throw) (new snowball%
- [sprite (make-object bitmap% "snowball.jpg" 'unknown #f)]
+ [sprite (make-object bitmap% "snowball.png" 'png/alpha #f)]
[x (get-x)]
[y (get-y)]))))
@@ -56,7 +56,7 @@
(class on-screen%
(super-new)
(inherit set-x! get-x)
- (init-field (speed 1) (distance 5)) ; speed is negative for snowballs thrown left
+ (init-field (speed 6) (distance 5)) ; speed is negative for snowballs thrown left
;---------------set-methods-----------------
(define/public (set-throw_param! new-speed new-distance) (begin (set! speed new-speed)
@@ -103,7 +103,7 @@
;----------instances-------------
(define *player*
- (new player% [sprite (make-object bitmap% "testbild.jpg" 'unknown #f)]))
+ (new player% [sprite (make-object bitmap% "testbild.png" 'png/alpha #f)]))
View
BIN snowball.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN testbild.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 978f58a

Please sign in to comment.