Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 June, 2013, 19:38:26 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: ti-nspire student software acting up PLEASE HELP! -  (Read 472 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
annoyingcalc
the annoying calculator
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 16:48:30
Date Registered: 14 April, 2011, 23:02:24
Location: In the glorious land of minecraft
Posts: 1782


Topic starter
Total Post Ratings: +57

View Profile WWW
« on: 02 September, 2012, 23:59:12 »
0

My nspire software wont load my program im trying it on the emulator in it and if I drag and drop the program on to the emulator it freezes and so does windows explorer. I try loading it from file>open it still crashes nspire software! HELP
« Last Edit: 03 September, 2012, 05:59:23 by annoyingcalc » Logged

Click here to see where you got your post ratings

My minecraft server is usually up, even if mcserverlist says it is down

Spoiler for siq:
Spoiler for signature:
annoyingcalc
the annoying calculator
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 16:48:30
Date Registered: 14 April, 2011, 23:02:24
Location: In the glorious land of minecraft
Posts: 1782


Topic starter
Total Post Ratings: +57

View Profile WWW
« Reply #1 on: 03 September, 2012, 02:07:41 »
0

*bump* Id like help! I cant test my programs untill this is fixed!
« Last Edit: 03 September, 2012, 02:08:22 by annoyingcalc » Logged

Click here to see where you got your post ratings

My minecraft server is usually up, even if mcserverlist says it is down

Spoiler for siq:
Spoiler for signature:
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Online Online

Gender: Male
Last Login: Today at 19:08:46
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50637


Total Post Ratings: +2639

View Profile WWW
« Reply #2 on: 03 September, 2012, 02:28:09 »
0

Are those programs written in Lua/BASIC? Because if they're Ndless files (or Lua for an outdated Student Software version), then that might be why. (The software doesn't run Ndless files and even Lua programs will have troubles running sometimes, such as Nyan Cat)
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
annoyingcalc
the annoying calculator
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 16:48:30
Date Registered: 14 April, 2011, 23:02:24
Location: In the glorious land of minecraft
Posts: 1782


Topic starter
Total Post Ratings: +57

View Profile WWW
« Reply #3 on: 03 September, 2012, 02:36:36 »
0

I am using lua for 3.1 with a 3.1 student software
Logged

Click here to see where you got your post ratings

My minecraft server is usually up, even if mcserverlist says it is down

Spoiler for siq:
Spoiler for signature:
annoyingcalc
the annoying calculator
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 16:48:30
Date Registered: 14 April, 2011, 23:02:24
Location: In the glorious land of minecraft
Posts: 1782


Topic starter
Total Post Ratings: +57

View Profile WWW
« Reply #4 on: 03 September, 2012, 05:52:12 »
0

im posting the .lua file to see if anyone else has this problem

* img.lua (297.41 KB - downloaded 10 times.)
Logged

Click here to see where you got your post ratings

My minecraft server is usually up, even if mcserverlist says it is down

Spoiler for siq:
Spoiler for signature:
adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: 14 June, 2013, 17:56:38
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1202


Total Post Ratings: +186

View Profile WWW
« Reply #5 on: 03 September, 2012, 11:21:43 »
0

Oh wow, do NOT ever do image stuff in a loop, that's what causing your issue ;-)

Here's how you want to do it :
(after the 2 lines of images strings)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
dx=50
dy=50

function on.paint(gc)
gc:drawImage(background,0,0)
gc:drawImage(duck,dx,dy)
end

function on.arrowKey(arrow)
if arrow == "right" then
dx = dx + 5
elseif arrow == "left" then
dx = dx - 5
elseif arrow == "up" then
dy = dy - 5
elseif arrow == "down" then
dy = dy + 5
end
platform.window:invalidate()
end

I suggest that you read Inspired-Lua's tutorials and Steve Arnold's Smiley
They really well explain the basic concept of events, the base thing you need to understand first Smiley

Also, to have a full reference of the Nspire-Lua API, don't forget Inspired-Lua's wiki (based on (and improving) the official doc)

BTW, Levak and I have created a presentation some weeks ago : "Improving your Nspire-Lua skills" you would be interested in : http://tiplanet.org/forum/archives_voir.php?id=6720 (clic on "Télécharger") - you might prefer the powerpoint version)
« Last Edit: 03 September, 2012, 11:57:22 by adriweb » Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
annoyingcalc
the annoying calculator
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 16:48:30
Date Registered: 14 April, 2011, 23:02:24
Location: In the glorious land of minecraft
Posts: 1782


Topic starter
Total Post Ratings: +57

View Profile WWW
« Reply #6 on: 03 September, 2012, 18:10:18 »
0

Wow! Thanks adriweb,but I want it to be an ai not the character im making duck hunt!
« Last Edit: 03 September, 2012, 18:19:18 by annoyingcalc » Logged

Click here to see where you got your post ratings

My minecraft server is usually up, even if mcserverlist says it is down

Spoiler for siq:
Spoiler for signature:
someone
LV3 Member (Next: 100)
***
Offline Offline

Gender: Male
Last Login: Yesterday at 18:49:38
Date Registered: 12 January, 2012, 19:07:23
Posts: 48


Total Post Ratings: +9

View Profile
« Reply #7 on: 04 September, 2012, 01:29:57 »
0

Then, instead of using the function on.arrowKey(arrow), create one where you calculate the move, e.g:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function AI()
    --place your Artificial Intelligence code here

    --if direction==1 then
    --dx=dx-1
    --dy=dy-1
    --else
    --dx=dx+1
    --dy=dy+1
    --end
    --if dx==0 then
    --direction=1
    --end
    --if dy==240 then
    --direction=0
    --end
end

BTW, I see that you use an image from the NES & since the resolution is smaller, it will look awkward, so I would suggest to draw the rest of the background, this code would do:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function on.resize(width, height)
    ww = width
    wh = height
end

function on.paint(gc)
    -- Paint background (sky)
    gc:setColorRGB(96, 176, 248)
    gc:fillRect(0, 0, ww, wh)
   
    -- Paint floor (dirt)
    gc:setColorRGB(104, 104, 0)
    gc:fillRect(0, 175, ww, wh-175)
   
    gc:drawImage(background,0,0)
    gc:drawImage(duck,dx,dy)
    AI()
end

Maybe you'll want to place drawing the duck image inside the AI() function, because if you're going to move the image a lot, it will look like it warps. So, you'll need to add the parameter "gc"


1
2
3
4
5
6
7
8
9
function on.paint(gc)
    ...
    AI(gc)
end

function AI(gc)
    gc:drawImage(duck,dx,dy)
end
Logged
annoyingcalc
the annoying calculator
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 16 June, 2013, 16:48:30
Date Registered: 14 April, 2011, 23:02:24
Location: In the glorious land of minecraft
Posts: 1782


Topic starter
Total Post Ratings: +57

View Profile WWW
« Reply #8 on: 04 September, 2012, 01:36:02 »
0

Well, yes thats what im planning on doing with the background well it was >2,500 kb and I edited it wrongly.
Logged

Click here to see where you got your post ratings

My minecraft server is usually up, even if mcserverlist says it is down

Spoiler for siq:
Spoiler for signature:
adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: 14 June, 2013, 17:56:38
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1202


Total Post Ratings: +186

View Profile WWW
« Reply #9 on: 04 September, 2012, 17:59:11 »
0

Yeah try not to use > 15k Undecided
Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.171 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.