Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 05-02-2006, 14:02   #1 (permalink)
Neuer User
 
Registriert seit: Oct 2005
Beiträge: 61
hüpfender Ball

Suche ein Actionscript für einen hüpfenden Ball, ohne irgendwelche Schnörkel und Pi-Pa-Po. Ich habe mich diesbezüglich schon mal im Forum umgeschaut habe aber keine einfaches Beispiel gefunden. Entweder waren sie völlig überladen mit irgendwelchen blinkenden Animationen und Fadung, oder Auftrumpfen bei einem bestimmten Winkel auf den Boden, etc.

Das was ich einfach nur such ist ein Actionscript ohne
- Fadung
- Auftreffwinkel
- wilde Animation
Sascha Laurent ist offline   Mit Zitat antworten
Alt 05-02-2006, 14:09   #2 (permalink)
Der Wunderhund
 
Benutzerbild von gaspode
 
Registriert seit: Jun 2002
Ort: Hattingen
Beiträge: 10.515
probiers mal hiermit.
ist ein code vom www.bit-101.com.
du brauchst nurnoch nen mc mit nem ball
drin und ne verknüpfung namen «ball».

gruß, gaspode

PHP-Code:

init
();
function 
init()
{
    
bounce = -0.7;
    
gravity 0.5;
    
top 0;
    
left 0;
    
bottom Stage.height;
    
right Stage.width;
    
ball attachMovie("ball""ball"0);
    
ball._x Stage.width 2;
    
ball._y Stage.height 2;
    
vx Math.random() * 10 5;
    
vy Math.random() * 10 5;
}
function 
onEnterFrame(Void):Void
{
    
vy += gravity;
    
ball._x += vx;
    
ball._y += vy;
    if (
ball._x ball._width right)
    {
        
ball._x right ball._width 2;
        
vx *= bounce;
    }
    else if (
ball._x ball._width left)
    {
        
ball._x left ball._width 2;
        
vx *= bounce;
    }
    if (
ball._y ball._height bottom)
    {
        
ball._y bottom ball._height 2;
        
vy *= bounce;
    }
    else if (
ball._y ball._height top)
    {
        
ball._y top ball._height 2;
        
vy *= bounce;
    }

gaspode ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 18:10 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele