Announcement

User registrations are currently disabled due to high spam traffic.

#1 16/03/08 11:14pm

rpgfaker
Member
Registered: 13/03/08
Posts: 7

anyone using liveswif...

How is the psp controls for mouseclick,up,down,left,right done?
 
    I want to take the example game in the advance sample file and try changing the control scheme so it can be reworked (it would make a nice start till I can get more advanced)

Offline

 

#2 16/03/08 11:50pm

Macaw!95
Addict
From: The internet
Registered: 01/11/07
Posts: 249
Website

Re: anyone using liveswif...

i belive its if(Key.isDown(Key. insert key)){
what you want to happen
}


helmet
Ghost Leader Ready To Go
Panic at the disco gave me the ! XD

Offline

 

#3 16/03/08 11:51pm

Jake
Administrator
Registered: 29/04/06
Posts: 307

Re: anyone using liveswif...

Not sure what the mouse controls in liveswif are, the directional pad on the PSP is the same as the arrow keys on the keyboard. In flash they have the key codes:
Up - 38
Down - 40
Left - 37
Right - 39
These should be the same in liveswif.


moose

Offline

 

#4 17/03/08 12:25am

rpgfaker
Member
Registered: 13/03/08
Posts: 7

Re: anyone using liveswif...

Hey,thanks Im not sure how to use this yet but Ill keep trying, thanks again.

Offline

 

#5 20/03/08 3:55pm

Dezerith
Moderator of Doom.
Registered: 27/07/07
Posts: 196
Website

Re: anyone using liveswif...

OK, here goes:

To make a sprite move left, right, up and down in LiveSwif...

in the onClipEvent(enterframe) syntaxof the sprite you want to move, type:

      if (Key.isDown(Key.LEFT)) {
        _x -= 5;
      }
      if (Key.isDown(Key.RIGHT)) {
        _x += 5;
      }
      if (Key.isDown(Key.UP)) {
        _x += 5;
      }
      if (Key.isDown(Key.DOWN)) {
        _x += 5;
      }

That's basically all you have to do. To change the speed in which your character goes, change the number in this section of each part of the code (5):

        _x += 5;

higher or lower according to how fast you want it to go. The higher the number, the faster.


[img]http://i26.tinypic.com/28iys08.jpg[/img]
[img]http://www.resiststorage.org/images/blazebytedev53.png[/img]
[img]http://www.resiststorage.org/images/PSPflashForDezBzeByteDev4.png[/img]

Offline

 

#6 22/03/08 3:33am

rpgfaker
Member
Registered: 13/03/08
Posts: 7

Re: anyone using liveswif...

Thanks Dezerith for that, now I just need the mouseclick and I'll be good to go

Offline

 

#7 22/03/08 11:26am

Macaw!95
Addict
From: The internet
Registered: 01/11/07
Posts: 249
Website

Re: anyone using liveswif...

look in the moovlin 1 source code hes got it i think


helmet
Ghost Leader Ready To Go
Panic at the disco gave me the ! XD

Offline

 

#8 22/03/08 11:49am

Dezerith
Moderator of Doom.
Registered: 27/07/07
Posts: 196
Website

Re: anyone using liveswif...

For mouseclick, just put

if(Key.isDown){
what you want to happen
}

in the onMouseDown syntax, as macaw said.

But that won't really get you anywhere... which brings me to my next point. If you want your character to jump onMouseDown (when you press x), this is what you've gotta do.

in the onEnterFrame syntax of your sprite, put:

++gravity;
      _y += gravity;
      if (Key.isDown(Key.LEFT)) {
        _x -= speed;   
      }
      if (Key.isDown(Key.RIGHT)) {
        _x += speed;
      }

      if (this.hitTest(_root.ground)) {
        _root.player.isJump = false;
        _root.player.gravity = 0;
        --_root.player._y;
      }

Change 'speed' to any number you wish (the higher the faster). Give your sprite an instance name of 'player'.

Now, in the onMouseDown syntax of your sprite that you named 'player', put:

    if (Key.isDown && isJump == false) {
        isJump = true;
        _y -= speed;
        gravity = -9;
      }

Again, change 'speed' to any number you wish (the higher the faster).

Now, in the onLoad syntax of the sprite, put:

gravity = 5;
speed = 10;
isJump = true;

Almost there. You now have to make a new sprite for the ground (i.e. where 'player' lands when he jumps). Go to Insert>Sprite then draw a box and fill it any colour you want. Go back to Scene 1, and drag and drop the sprite you just made onto your canvas. Give it an instance name of 'ground'. Now hit the preview button. If you need any more help just say so.


[img]http://i26.tinypic.com/28iys08.jpg[/img]
[img]http://www.resiststorage.org/images/blazebytedev53.png[/img]
[img]http://www.resiststorage.org/images/PSPflashForDezBzeByteDev4.png[/img]

Offline

 

#9 23/03/08 4:51am

rpgfaker
Member
Registered: 13/03/08
Posts: 7

Re: anyone using liveswif...

Thanks this helps alot, I've been checking out the moovlin source but I can't find what frame the action script was put into for the controls. Edit: jfig111 posted his code on another topic so ok I'm good there. just cant figure out where it was put in the game ,I'll look again...

Also I tried using jpeg photos on my project and the file size was too large so is there a better format to save in or should I use the liveswif graphics tools?

Last edited by rpgfaker (23/03/08 5:26am)

Offline

 

#10 23/03/08 8:19am

rollinroll
Moderator
Registered: 23/10/06
Posts: 1890

Re: anyone using liveswif...

The controls is put in the action script the character has i think...

Offline

 

#11 23/03/08 12:46pm

Dezerith
Moderator of Doom.
Registered: 27/07/07
Posts: 196
Website

Re: anyone using liveswif...

rpgfaker wrote:

Thanks this helps alot, I've been checking out the moovlin source but I can't find what frame the action script was put into for the controls. Edit: jfig111 posted his code on another topic so ok I'm good there. just cant figure out where it was put in the game ,I'll look again...

Also I tried using jpeg photos on my project and the file size was too large so is there a better format to save in or should I use the liveswif graphics tools?

Yep, as rollinroll said, all of that actionscript can be found by going to a frame in the moovlin source code, clicking on moovlin and copy and pasting the code from it's on(ClipEvent)enterFrame syntax.

And I recommend not importing images into LiveSwif but drawing them yourself. It's much easier and there are lots of bugs when it comes to added external images onto your canvas.


[img]http://i26.tinypic.com/28iys08.jpg[/img]
[img]http://www.resiststorage.org/images/blazebytedev53.png[/img]
[img]http://www.resiststorage.org/images/PSPflashForDezBzeByteDev4.png[/img]

Offline

 

#12 23/03/08 2:11pm

rpgfaker
Member
Registered: 13/03/08
Posts: 7

Re: anyone using liveswif...

Thanks again now I'll try to figure this all out (but the drawing tools suck)

Offline

 

#13 23/03/08 7:45pm

Dezerith
Moderator of Doom.
Registered: 27/07/07
Posts: 196
Website

Re: anyone using liveswif...

rpgfaker wrote:

Thanks again now I'll try to figure this all out (but the drawing tools suck)

They don't suck once you get used to them. Once you work out that the spline tool is actually the curve tool and the curve tool makes straight lines and allows you to join them up, you're almost good to go. Never use the pencil tool, it sucks. And at blazebyte jfig111 wrote a tut on how to do gradients in the flash and graphics forum. Oh and the text tool is good...


[img]http://i26.tinypic.com/28iys08.jpg[/img]
[img]http://www.resiststorage.org/images/blazebytedev53.png[/img]
[img]http://www.resiststorage.org/images/PSPflashForDezBzeByteDev4.png[/img]

Offline

 

#14 17/05/08 1:36am

nothing
Moderator
Registered: 21/03/08
Posts: 389

Re: anyone using liveswif...

Dezerith wrote:

For mouseclick, just put

if(Key.isDown){
what you want to happen
}

in the onMouseDown syntax, as macaw said.

But that won't really get you anywhere... which brings me to my next point. If you want your character to jump onMouseDown (when you press x), this is what you've gotta do.

in the onEnterFrame syntax of your sprite, put:

++gravity;
      _y += gravity;
      if (Key.isDown(Key.LEFT)) {
        _x -= speed;   
      }
      if (Key.isDown(Key.RIGHT)) {
        _x += speed;
      }

      if (this.hitTest(_root.ground)) {
        _root.player.isJump = false;
        _root.player.gravity = 0;
        --_root.player._y;
      }

Change 'speed' to any number you wish (the higher the faster). Give your sprite an instance name of 'player'.

Now, in the onMouseDown syntax of your sprite that you named 'player', put:

    if (Key.isDown && isJump == false) {
        isJump = true;
        _y -= speed;
        gravity = -9;
      }

Again, change 'speed' to any number you wish (the higher the faster).

Now, in the onLoad syntax of the sprite, put:

gravity = 5;
speed = 10;
isJump = true;

Almost there. You now have to make a new sprite for the ground (i.e. where 'player' lands when he jumps). Go to Insert>Sprite then draw a box and fill it any colour you want. Go back to Scene 1, and drag and drop the sprite you just made onto your canvas. Give it an instance name of 'ground'. Now hit the preview button. If you need any more help just say so.

How do I do this with multiple "ground"s? It always falls through.


[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]

I'm starting p22 again.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson