Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: starting out psp programming

                  
   
  1. #11
    DCEmu Coder BrooksyX's Avatar
    Join Date
    Feb 2006
    Location
    Washington, U.S.
    Age
    35
    Posts
    1,336
    Rep Power
    88

    Default

    yeah lua is a pretty easy language to pick up. You will understand the basics real fast.


  2. #12
    DCEmu Rookie
    Join Date
    Apr 2006
    Posts
    122
    Rep Power
    70

    Default

    so ur saying if i read enough online tutorials then ill know how to do lua??

  3. #13
    GP2X Coder/Moderator
    Join Date
    Jan 2006
    Posts
    1,678
    Rep Power
    87

    Default

    Lua is a small enough language to pick up from online tutorials. Learning how to actually *program* is a completely different matter though.

  4. #14
    DCEmu Pro jman420's Avatar
    Join Date
    Oct 2005
    Location
    Colorado, USA
    Posts
    756
    Rep Power
    76

    Default

    Lua is a scripting language, which basicly means that you make a code to be read by another piece of software (luaplayer)

    what you do is tell the software (luaplayer) to do whatever is in your script (your lua code)

    all that realy means is, you dont have to program handlers and information storage, you just create your script, and run it by the luaplayer.

    on a C/C++ program you would have to call all functions prior to compiling and running your game

    so Lua is realy easy to use, because its just for reading and executing scripts

    what it will do for you is teach you the methods used to create simple games using some functions.

    in my case, I picked up on the "if" statement, which will do most anything you need it to ( I know, its a poor way to do it ) but its easy to understand.. and will also come in with a lot of C/C++ coding that you may do, so its always good to know how to do these kinds of things

    one of the most simple ways to look at Lua is that its a lot like talking to the PSP, most of the code that you will use is simple enough that you can read it back and understand it, because its alot like english

    eg.


    if pad:left() then
    player.x = player.x + 2
    end

    what this will do is if the pad button left is pressed, then player.x (your player's X position) equals your players.x position plus 2. then later on in the code, you will blit the player, using its X coordinates as the position of the picture to be blitted

    thats not an important piece of code, but it will surely come into your code somewhere, but I only said it as an example of just how simple Lua is to understand.

    Lua uses a very simple method to create games, most everything is called as a variable, using very little accual code. An intire game can be from 20 lines, to 500 lines, to over a thousand. but most of it can be written in very simple (and easy to understand) methods.

    just some information on the differences between Lua coding, and accual C/C++ code.

    hope this was helpful
    and if you have any questions, that I may be able to help with, feal free to send me a PM or talk to me over AIM, MSN, or Yahoo (my screen names are under my name and icon to the left)

    and about your question about if you will learn how to do it from the tutorials. you can only learn it if you can understand it, if you dont accualy know what the statements and functions do, you could be just as lost as if you never made a game. but thats why I emphasized on just how simple Lua is, you should have no problem understanding it. and when you understand Lua, a lot of the first parts of creating a C/C++ program will be just a easy to understand, because you will have already learned a few of the functions, and how to use them

  5. #15
    GP2X Coder/Moderator
    Join Date
    Jan 2006
    Posts
    1,678
    Rep Power
    87

    Default

    if pad:left() then
    player.x = player.x + 2
    end

    what this will do is if the pad button left is pressed, then player.x (your player's X position) equals your players.x position plus 2. then later on in the code, you will blit the player, using its X coordinates as the position of the picture to be blitted
    Be careful here. What pad:left() actually does is call a function that is associated with the variable/object/class pad. It returns true (1) if the left was pressed and false (0) is it wasn't. An if statement will check if the expression following (in this case pad:left() ) equates to true, if it does it will execute the code between 'then' and 'end'. If false, it will 'jump' to end and carry on with the rest of the code.

    Basically as soon as you have understood the if/else statement, for and while loops, functions, parameter passing, return values, tables/arrays, program flow and scope. That's it, you have understood the basics of any programming language and may as well move onto C/C++/Java/C# or even Python if you don't want to make too big a jump.

  6. #16
    DCEmu Pro jman420's Avatar
    Join Date
    Oct 2005
    Location
    Colorado, USA
    Posts
    756
    Rep Power
    76

    Default

    right, that was simply and example of how Lua is easy to understand, and a lot like english.. not accualy a lesson on how to use the pad:left.. as it is using pad in your code, will do absolutly nothing but exit the app with a nil value for pad... as I never called that pad = Controls.read

  7. #17
    PSP User \/oid's Avatar
    Join Date
    May 2006
    Location
    south africa
    Age
    39
    Posts
    42
    Rep Power
    0

    Default

    mmmm you guys are tempting me to start again with c++The only problem is time...and programming takes allot of it.Luckly 4 me i'm very good at oo-programming so learning c++ will mostly just be allot of syntax..and memory management.....curses i like java soooo much more..if only a java vm could run on the psp
    hehehehe maby in the future........

  8. #18
    DCEmu Regular the one and only's Avatar
    Join Date
    May 2006
    Location
    Termina
    Age
    19
    Posts
    293
    Rep Power
    71

    Default

    lol, i should of looked at this thread more often, i started learning c++ last night from psdonkey's thread on psp hacks, pretty simple stuff. although i havent got past liek cin and increment and decrement. im probably just gonna stick with learnin c++.

    Thanks for ur posts

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •